1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-29 06:43:02 +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."); if (endIndex < 0) throw new ArgumentOutOfRangeException(nameof(endIndex), $"{nameof(endIndex)} cannot be < 0.");
int extendedEndIndex = endIndex; int extendedEndIndex = endIndex;
if (endIndex < beatmap.HitObjects.Count - 1)
{
// Extend the end index to include objects they are stacked on // Extend the end index to include objects they are stacked on
for (int i = endIndex; i >= startIndex; i--) for (int i = endIndex; i >= startIndex; i--)
{ {
@ -79,6 +80,7 @@ namespace osu.Game.Rulesets.Osu.Beatmaps
break; break;
} }
} }
}
//Reverse pass for stack calculation. //Reverse pass for stack calculation.
int extendedStartIndex = startIndex; int extendedStartIndex = startIndex;