Remove previous consumption logic in GetWorkingBeatmap

This should not be required since the introduction of `workingCache`,
which does the same thing in a more global way.
This commit is contained in:
Dean Herbert
2021-05-31 14:11:57 +09:00
parent ab077c6656
commit 06bd696cc2
4 changed files with 8 additions and 11 deletions

View File

@ -280,9 +280,8 @@ namespace osu.Game.Beatmaps
/// Retrieve a <see cref="WorkingBeatmap"/> instance for the provided <see cref="BeatmapInfo"/>
/// </summary>
/// <param name="beatmapInfo">The beatmap to lookup.</param>
/// <param name="previous">The currently loaded <see cref="WorkingBeatmap"/>. Allows for optimisation where elements are shared with the new beatmap. May be returned if beatmapInfo requested matches</param>
/// <returns>A <see cref="WorkingBeatmap"/> instance correlating to the provided <see cref="BeatmapInfo"/>.</returns>
public virtual WorkingBeatmap GetWorkingBeatmap(BeatmapInfo beatmapInfo, WorkingBeatmap previous = null)
public virtual WorkingBeatmap GetWorkingBeatmap(BeatmapInfo beatmapInfo)
{
if (beatmapInfo?.BeatmapSet == null)
return DefaultBeatmap;
@ -294,9 +293,6 @@ namespace osu.Game.Beatmaps
beatmapInfo = QueryBeatmap(b => b.ID == lookupId);
}
if (beatmapInfo.ID > 0 && previous != null && previous.BeatmapInfo?.ID == beatmapInfo.ID)
return previous;
lock (workingCache)
{
var working = workingCache.FirstOrDefault(w => w.BeatmapInfo?.ID == beatmapInfo.ID);