mirror of
https://github.com/ppy/osu
synced 2025-01-31 10:22:02 +00:00
Use while loops instead
This commit is contained in:
parent
46f17885c6
commit
6c580ac9d5
@ -158,15 +158,13 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
if (time > breaks[currentBreakIndex].EndTime)
|
if (time > breaks[currentBreakIndex].EndTime)
|
||||||
{
|
{
|
||||||
for (; currentBreakIndex < breaks.Count; currentBreakIndex++)
|
while (time > breaks[currentBreakIndex].EndTime && currentBreakIndex < breaks.Count - 1)
|
||||||
if (time <= breaks[currentBreakIndex].EndTime)
|
currentBreakIndex++;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
else if (time < breaks[currentBreakIndex].StartTime)
|
else if (time < breaks[currentBreakIndex].StartTime)
|
||||||
{
|
{
|
||||||
for (; currentBreakIndex >= 0; currentBreakIndex--)
|
while (time < breaks[currentBreakIndex].StartTime && currentBreakIndex > 0)
|
||||||
if (time >= breaks[currentBreakIndex].StartTime)
|
currentBreakIndex--;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// This ensures that IsBreakTime is generally consistent with the overlay's transforms during a break.
|
// This ensures that IsBreakTime is generally consistent with the overlay's transforms during a break.
|
||||||
|
Loading…
Reference in New Issue
Block a user