1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-15 02:17:46 +08:00

Avoid overhead from retrieving MaxCombo inside loop from realm

This commit is contained in:
Dean Herbert 2023-06-13 02:05:00 +09:00
parent 0916ae1671
commit 87520ae400

View File

@ -14,6 +14,9 @@ namespace osu.Game.Database
{ {
public static long GetNewStandardised(ScoreInfo score) public static long GetNewStandardised(ScoreInfo score)
{ {
// Avoid retrieving from realm inside loops.
int maxCombo = score.MaxCombo;
var ruleset = score.Ruleset.CreateInstance(); var ruleset = score.Ruleset.CreateInstance();
var processor = ruleset.CreateScoreProcessor(); var processor = ruleset.CreateScoreProcessor();
@ -61,7 +64,7 @@ namespace osu.Game.Database
if (result == HitResult.Miss || result == HitResult.LargeTickMiss) if (result == HitResult.Miss || result == HitResult.LargeTickMiss)
continue; continue;
if (processor.Combo.Value == score.MaxCombo) if (processor.Combo.Value == maxCombo)
{ {
if (misses.Count > 0) if (misses.Count > 0)
{ {