Revert unnecessary BeatmapManager change

This commit is contained in:
smoogipoo
2021-04-22 23:04:54 +09:00
parent 64579d50ac
commit 22a3f3ad3e

View File

@ -281,9 +281,8 @@ namespace osu.Game.Beatmaps
/// </summary> /// </summary>
/// <param name="beatmapInfo">The beatmap to lookup.</param> /// <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> /// <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>
/// <param name="bypassCache">Whether to bypass the cache and return a new <see cref="WorkingBeatmap"/> instance.</param>
/// <returns>A <see cref="WorkingBeatmap"/> instance correlating to the provided <see cref="BeatmapInfo"/>.</returns> /// <returns>A <see cref="WorkingBeatmap"/> instance correlating to the provided <see cref="BeatmapInfo"/>.</returns>
public WorkingBeatmap GetWorkingBeatmap(BeatmapInfo beatmapInfo, WorkingBeatmap previous = null, bool bypassCache = false) public WorkingBeatmap GetWorkingBeatmap(BeatmapInfo beatmapInfo, WorkingBeatmap previous = null)
{ {
if (beatmapInfo?.ID > 0 && previous != null && previous.BeatmapInfo?.ID == beatmapInfo.ID) if (beatmapInfo?.ID > 0 && previous != null && previous.BeatmapInfo?.ID == beatmapInfo.ID)
return previous; return previous;
@ -302,14 +301,9 @@ namespace osu.Game.Beatmaps
lock (workingCache) lock (workingCache)
{ {
BeatmapManagerWorkingBeatmap working; var working = workingCache.FirstOrDefault(w => w.BeatmapInfo?.ID == beatmapInfo.ID);
if (!bypassCache)
{
working = workingCache.FirstOrDefault(w => w.BeatmapInfo?.ID == beatmapInfo.ID);
if (working != null) if (working != null)
return working; return working;
}
beatmapInfo.Metadata ??= beatmapInfo.BeatmapSet.Metadata; beatmapInfo.Metadata ??= beatmapInfo.BeatmapSet.Metadata;