Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use stable sort for catch hyperdash generation #22499

Merged
merged 8 commits into from
Dec 13, 2023
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ private static void initialiseHyperDash(IBeatmap beatmap)
}
}

palpableObjects.Sort((h1, h2) => h1.StartTime.CompareTo(h2.StartTime));
palpableObjects = palpableObjects.OrderBy(h => h.StartTime).ToList();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the stability of the sort is important, then there should be an inline comment about it or a test covering it. Or both. Otherwise there's no transparent reason why this particular one way to sort out of the multiple ones offered by the standard library is used here precisely.


double halfCatcherWidth = Catcher.CalculateCatchWidth(beatmap.Difficulty) / 2;

Expand Down