From 620e9737c33a9d02626d4cbf8fcf579f267e3471 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 21 Dec 2017 22:33:16 +0900 Subject: [PATCH] Avoid many many unnecessary enumerations --- osu.Game/Beatmaps/BeatmapManager.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index 1544d4fc01..0325785016 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -343,9 +343,9 @@ namespace osu.Game.Beatmaps public void UndeleteAll() { - var mapSets = QueryBeatmapSets(bs => bs.DeletePending); + var deleteMaps = QueryBeatmapSets(bs => bs.DeletePending).ToList(); - if (!mapSets.Any()) return; + if (!deleteMaps.Any()) return; var notification = new ProgressNotification { @@ -358,14 +358,14 @@ namespace osu.Game.Beatmaps int i = 0; - foreach (var bs in mapSets) + foreach (var bs in deleteMaps) { if (notification.State == ProgressNotificationState.Cancelled) // user requested abort return; - notification.Text = $"Restoring ({i} of {mapSets.Count()})"; - notification.Progress = (float)++i / mapSets.Count(); + notification.Text = $"Restoring ({i} of {deleteMaps.Count})"; + notification.Progress = (float)++i / deleteMaps.Count; Undelete(bs); }