mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 04:42:58 +08:00
Use TakeWhile instead of reversing the list.
This commit is contained in:
parent
9078444a62
commit
9b0309e683
@ -59,8 +59,8 @@ namespace osu.Game.Overlays.Music
|
||||
{
|
||||
get
|
||||
{
|
||||
var available = items.Children.Reverse();
|
||||
return (available.SkipWhile(i => !i.Selected).Skip(1).FirstOrDefault() ?? available.FirstOrDefault())?.BeatmapSetInfo;
|
||||
var available = items.Children;
|
||||
return (available.TakeWhile(i => !i.Selected).LastOrDefault() ?? available.LastOrDefault())?.BeatmapSetInfo;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user