Use while loops instead

This commit is contained in:
iiSaLMaN 2019-07-27 15:52:01 +03:00
parent 46f17885c6
commit 6c580ac9d5

View File

@ -158,15 +158,13 @@ namespace osu.Game.Screens.Play
if (time > breaks[currentBreakIndex].EndTime)
{
for (; currentBreakIndex < breaks.Count; currentBreakIndex++)
if (time <= breaks[currentBreakIndex].EndTime)
break;
while (time > breaks[currentBreakIndex].EndTime && currentBreakIndex < breaks.Count - 1)
currentBreakIndex++;
}
else if (time < breaks[currentBreakIndex].StartTime)
{
for (; currentBreakIndex >= 0; currentBreakIndex--)
if (time >= breaks[currentBreakIndex].StartTime)
break;
while (time < breaks[currentBreakIndex].StartTime && currentBreakIndex > 0)
currentBreakIndex--;
}
// This ensures that IsBreakTime is generally consistent with the overlay's transforms during a break.