1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-05 09:32:54 +08:00

Shortcut O(n^2) calculation

This commit is contained in:
smoogipoo 2019-01-07 17:57:45 +09:00
parent 1c5ab6a906
commit 351ab6e9bd

View File

@ -41,7 +41,8 @@ namespace osu.Game.Rulesets.Osu.Beatmaps
if (endIndex < 0) throw new ArgumentOutOfRangeException(nameof(endIndex), $"{nameof(endIndex)} cannot be < 0.");
int extendedEndIndex = endIndex;
if (endIndex < beatmap.HitObjects.Count - 1)
{
// Extend the end index to include objects they are stacked on
for (int i = endIndex; i >= startIndex; i--)
{
@ -79,6 +80,7 @@ namespace osu.Game.Rulesets.Osu.Beatmaps
break;
}
}
}
//Reverse pass for stack calculation.
int extendedStartIndex = startIndex;