From ed84cd2035a1d4624c0ef15014249ee8ba03c699 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 25 Oct 2017 19:32:00 +0900 Subject: [PATCH] Greatly improve performance of direct panel loading Still needs to be async'd --- osu.Game/Overlays/DirectOverlay.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/osu.Game/Overlays/DirectOverlay.cs b/osu.Game/Overlays/DirectOverlay.cs index 14110724ea..5fbb78f82e 100644 --- a/osu.Game/Overlays/DirectOverlay.cs +++ b/osu.Game/Overlays/DirectOverlay.cs @@ -274,11 +274,12 @@ namespace osu.Game.Overlays Filter.DisplayStyleControl.Dropdown.Current.Value, Filter.Tabs.Current.Value); //todo: sort direction (?) - getSetsRequest.Success += r => + getSetsRequest.Success += response => { - BeatmapSets = r?. - Select(response => response.ToBeatmapSet(rulesets)). - Where(b => beatmaps.QueryBeatmapSet(q => q.OnlineBeatmapSetID == b.OnlineBeatmapSetID) == null); + var onlineIds = response.Select(r => r.OnlineBeatmapSetID); + var presentOnlineIds = beatmaps.QueryBeatmapSets(s => onlineIds.Contains(s.OnlineBeatmapSetID)).Select(r => r.OnlineBeatmapSetID).ToList(); + + BeatmapSets = response.Select(r => r.ToBeatmapSet(rulesets)).Where(b => !presentOnlineIds.Contains(b.OnlineBeatmapSetID)); recreatePanels(Filter.DisplayStyleControl.DisplayStyle.Value); };