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

Merge pull request #20300 from peppy/stable-sort-local-scores

Fix local scores potentially not being stable-sorted for leaderboard display
This commit is contained in:
Dan Balasescu 2022-09-14 15:11:07 +09:00 committed by GitHub
commit 90e5949e9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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"/>.