From f36bc51520882b3769bfd34356a9e970d053cfe8 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 25 Mar 2025 22:25:56 +0900 Subject: [PATCH] Inline method calls to make multiple enumerations explicit --- osu.Game/Overlays/MusicController.cs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index 6d7c26b51b..da5388534c 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -257,10 +257,8 @@ namespace osu.Game.Overlays playableSet = getNextRandom(-1, allowProtectedTracks); else { - var beatmapSets = getBeatmapSets(allowProtectedTracks); - - playableSet = beatmapSets.TakeWhile(i => !i.Value.Equals(current?.BeatmapSetInfo)).LastOrDefault() - ?? beatmapSets.LastOrDefault(); + playableSet = getBeatmapSets(allowProtectedTracks).TakeWhile(i => !i.Value.Equals(current?.BeatmapSetInfo)).LastOrDefault() + ?? getBeatmapSets(allowProtectedTracks).LastOrDefault(); } if (playableSet != null) @@ -355,9 +353,8 @@ namespace osu.Game.Overlays playableSet = getNextRandom(1, allowProtectedTracks); else { - var beatmapSets = getBeatmapSets(allowProtectedTracks); - - playableSet = beatmapSets.SkipWhile(i => !i.Value.Equals(current?.BeatmapSetInfo)).ElementAtOrDefault(1) ?? beatmapSets.FirstOrDefault(); + playableSet = getBeatmapSets(allowProtectedTracks).SkipWhile(i => !i.Value.Equals(current?.BeatmapSetInfo)).ElementAtOrDefault(1) + ?? getBeatmapSets(allowProtectedTracks).FirstOrDefault(); } var playableBeatmap = playableSet?.Value.Beatmaps.FirstOrDefault();