From a5aeb2ff9e98f6d0a034548c2bc6664359f8ade2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 5 Feb 2024 18:56:20 +0100 Subject: [PATCH] Use better variable names It's not the 1970s. We can spare a few extra letters. --- osu.Game/Rulesets/Scoring/HitEventExtensions.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/osu.Game/Rulesets/Scoring/HitEventExtensions.cs b/osu.Game/Rulesets/Scoring/HitEventExtensions.cs index ab36a54d3d..f9c6d62608 100644 --- a/osu.Game/Rulesets/Scoring/HitEventExtensions.cs +++ b/osu.Game/Rulesets/Scoring/HitEventExtensions.cs @@ -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); } ///