Use MaxBy in all locations that can and update inspection level to match dotnet-build

This commit is contained in:
Dean Herbert
2022-12-19 16:42:21 +09:00
parent 8a01a22612
commit 4a7d7c6ed9
14 changed files with 17 additions and 28 deletions

View File

@ -79,9 +79,7 @@ namespace osu.Game.Rulesets.UI
// We need to use lifetime entries to find the next object (we can't just use `hitObjectContainer.Objects` due to pooling - it may even be empty).
// If required, we can make this lookup more efficient by adding support to get next-future-entry in LifetimeEntryManager.
fallbackObject = hitObjectContainer.Entries
.Where(e => e.Result?.HasResult != true)
.OrderBy(e => e.HitObject.StartTime)
.FirstOrDefault();
.Where(e => e.Result?.HasResult != true).MinBy(e => e.HitObject.StartTime);
// In the case there are no unjudged objects, the last hit object should be used instead.
fallbackObject ??= hitObjectContainer.Entries.LastOrDefault();