1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 10:18:22 +08:00

Fix local scores potentially not being stable-sorted for leaderboard display

This commit is contained in:
Dean Herbert 2022-09-14 14:19:53 +09:00
parent ef6d60ffe9
commit bc07513c3c

View File

@ -58,7 +58,10 @@ namespace osu.Game.Scoring
/// <param name="scores">The array of <see cref="ScoreInfo"/>s to reorder.</param>
/// <returns>The given <paramref name="scores"/> ordered by decreasing total score.</returns>
public IEnumerable<ScoreInfo> OrderByTotalScore(IEnumerable<ScoreInfo> scores)
=> scores.OrderByDescending(s => GetTotalScore(s)).ThenBy(s => s.OnlineID);
=> scores.OrderByDescending(s => GetTotalScore(s))
.ThenBy(s => s.OnlineID)
// Local scores may not have an online ID. Fall back to date in these cases.
.ThenBy(s => s.Date);
/// <summary>
/// Retrieves a bindable that represents the total score of a <see cref="ScoreInfo"/>.