From e9269dc83bb5df8db8e9bf470cf9f263ff42ee27 Mon Sep 17 00:00:00 2001 From: Samuel Van Allen Date: Tue, 2 Apr 2019 23:57:31 +0800 Subject: [PATCH 1/2] Prevent unnecessary query in OsuGame::PresentBeatmap This resolves issue #4575 --- osu.Game/OsuGame.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index f8ca1bc65f..9ab09d1122 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -254,6 +254,12 @@ namespace osu.Game if (menuScreen.IsCurrentScreen()) menuScreen.LoadToSolo(); + // we might even already be at the song + if (Beatmap.Value.BeatmapSetInfo.OnlineBeatmapSetID == beatmap.OnlineBeatmapSetID) + { + return; + } + // Use first beatmap available for current ruleset, else switch ruleset. var first = databasedSet.Beatmaps.Find(b => b.Ruleset == ruleset.Value) ?? databasedSet.Beatmaps.First(); From 55a6e43778da2a932f1b7ae41e713107c7fae54e Mon Sep 17 00:00:00 2001 From: Samuel Van Allen Date: Wed, 3 Apr 2019 21:49:33 +0800 Subject: [PATCH 2/2] Check against databasedSet instead of function param --- osu.Game/OsuGame.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 9ab09d1122..b31b9e5e87 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -255,7 +255,7 @@ namespace osu.Game menuScreen.LoadToSolo(); // we might even already be at the song - if (Beatmap.Value.BeatmapSetInfo.OnlineBeatmapSetID == beatmap.OnlineBeatmapSetID) + if (Beatmap.Value.BeatmapSetInfo.Hash == databasedSet.Hash) { return; }