1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 17:43:05 +08:00

Use better variable names

It's not the 1970s. We can spare a few extra letters.
This commit is contained in:
Bartłomiej Dach 2024-02-05 18:56:20 +01:00
parent 57bc5ee04f
commit a5aeb2ff9e
No known key found for this signature in database

View File

@ -22,8 +22,8 @@ namespace osu.Game.Rulesets.Scoring
Debug.Assert(hitEvents.All(ev => ev.GameplayRate != null)); Debug.Assert(hitEvents.All(ev => ev.GameplayRate != null));
int count = 0; int count = 0;
double m = 0; double mean = 0;
double s = 0; double sumOfSquares = 0;
foreach (var e in hitEvents) foreach (var e in hitEvents)
{ {
@ -34,15 +34,15 @@ namespace osu.Game.Rulesets.Scoring
// Division by gameplay rate is to account for TimeOffset scaling with gameplay rate. // Division by gameplay rate is to account for TimeOffset scaling with gameplay rate.
double currentValue = e.TimeOffset / e.GameplayRate!.Value; double currentValue = e.TimeOffset / e.GameplayRate!.Value;
double mNext = m + (currentValue - m) / count; double nextMean = mean + (currentValue - mean) / count;
s += (currentValue - m) * (currentValue - mNext); sumOfSquares += (currentValue - mean) * (currentValue - nextMean);
m = mNext; mean = nextMean;
} }
if (count == 0) if (count == 0)
return null; return null;
return 10.0 * Math.Sqrt(s / count); return 10.0 * Math.Sqrt(sumOfSquares / count);
} }
/// <summary> /// <summary>