1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 12:33:01 +08:00

Ensure beatmap set is always detached when updating

Slight performance improvement by doing the detach as early as possible.
This commit is contained in:
Dean Herbert 2024-07-09 16:58:35 +09:00
parent e734cdfee5
commit 63b4327978
No known key found for this signature in database

View File

@ -417,16 +417,23 @@ namespace osu.Game.Screens.Select
}
}
public void UpdateBeatmapSet(BeatmapSetInfo beatmapSet) => Schedule(() =>
public void UpdateBeatmapSet(BeatmapSetInfo beatmapSet)
{
updateBeatmapSet(beatmapSet);
invalidateAfterChange();
});
beatmapSet = beatmapSet.Detach();
Schedule(() =>
{
updateBeatmapSet(beatmapSet);
invalidateAfterChange();
});
}
private void updateBeatmapSet(BeatmapSetInfo beatmapSet)
{
beatmapSet = beatmapSet.Detach();
originalBeatmapSetsDetached.RemoveAll(set => set.ID == beatmapSet.ID);
originalBeatmapSetsDetached.Add(beatmapSet.Detach());
originalBeatmapSetsDetached.Add(beatmapSet);
var newSets = new List<CarouselBeatmapSet>();