1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-18 01:23:05 +08:00

Use full async flow rather than ContinueWith

This commit is contained in:
Dean Herbert 2024-10-22 18:47:04 +09:00
parent 6ea1623889
commit 187fa5eccd
No known key found for this signature in database

View File

@ -810,19 +810,19 @@ namespace osu.Game.Online.Multiplayer
protected async Task PopulateUsers(IEnumerable<MultiplayerRoomUser> multiplayerUsers) protected async Task PopulateUsers(IEnumerable<MultiplayerRoomUser> multiplayerUsers)
{ {
var request = new GetUsersRequest(multiplayerUsers.Select(u => u.UserID).Distinct().ToArray()); var request = new GetUsersRequest(multiplayerUsers.Select(u => u.UserID).Distinct().ToArray());
await API.PerformAsync(request).ContinueWith(t =>
{ await API.PerformAsync(request).ConfigureAwait(false);
if (request.Response == null) if (request.Response == null)
return; return;
var users = request.Response.Users.ToDictionary(user => user.Id); Dictionary<int, APIUser> users = request.Response.Users.ToDictionary(user => user.Id);
foreach (var multiplayerUser in multiplayerUsers) foreach (var multiplayerUser in multiplayerUsers)
{ {
if (users.TryGetValue(multiplayerUser.UserID, out var user)) if (users.TryGetValue(multiplayerUser.UserID, out var user))
multiplayerUser.User = user; multiplayerUser.User = user;
} }
}).ConfigureAwait(false);
} }
/// <summary> /// <summary>