mirror of https://github.com/ppy/osu
Avoid querying `GetLastObjectTime` twice in editor seek flow
This commit is contained in:
parent
809d02cda0
commit
a2db0afe19
|
@ -537,10 +537,14 @@ protected override bool OnKeyDown(KeyDownEvent e)
|
|||
// Seek to last object time, or track end if already there.
|
||||
// Note that in osu-stable subsequent presses when at track end won't return to last object.
|
||||
// This has intentionally been changed to make it more useful.
|
||||
if (!editorBeatmap.HitObjects.Any() || clock.CurrentTime == editorBeatmap.GetLastObjectTime())
|
||||
if (!editorBeatmap.HitObjects.Any())
|
||||
{
|
||||
clock.Seek(clock.TrackLength);
|
||||
else
|
||||
clock.Seek(editorBeatmap.GetLastObjectTime());
|
||||
return true;
|
||||
}
|
||||
|
||||
double lastObjectTime = editorBeatmap.GetLastObjectTime();
|
||||
clock.Seek(clock.CurrentTime == lastObjectTime ? clock.TrackLength : lastObjectTime);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue