1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 09:07:52 +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));
int count = 0;
double m = 0;
double s = 0;
double mean = 0;
double sumOfSquares = 0;
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.
double currentValue = e.TimeOffset / e.GameplayRate!.Value;
double mNext = m + (currentValue - m) / count;
s += (currentValue - m) * (currentValue - mNext);
m = mNext;
double nextMean = mean + (currentValue - mean) / count;
sumOfSquares += (currentValue - mean) * (currentValue - nextMean);
mean = nextMean;
}
if (count == 0)
return null;
return 10.0 * Math.Sqrt(s / count);
return 10.0 * Math.Sqrt(sumOfSquares / count);
}
/// <summary>