1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-13 16:13:34 +08:00

Rewrite backwards assertion

This commit is contained in:
Poyo 2023-11-21 15:19:04 -08:00
parent 0cf925dadf
commit 3a0586a8f5

View File

@ -19,7 +19,7 @@ namespace osu.Game.Rulesets.Scoring
/// </returns>
public static double? CalculateUnstableRate(this IEnumerable<HitEvent> hitEvents)
{
Debug.Assert(!hitEvents.Any(ev => ev.GameplayRate == null));
Debug.Assert(hitEvents.All(ev => ev.GameplayRate != null));
// Division by gameplay rate is to account for TimeOffset scaling with gameplay rate.
double[] timeOffsets = hitEvents.Where(affectsUnstableRate).Select(ev => ev.TimeOffset / ev.GameplayRate!.Value).ToArray();