1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-31 14:30:30 +08:00

Sanitise and remove some usages of Detach which are no longer required

This commit is contained in:
Dean Herbert
2022-01-12 15:34:39 +09:00
Unverified
parent 5f7365e8f3
commit 34aa1bf21d
5 changed files with 4 additions and 8 deletions
+1 -2
View File
@@ -10,7 +10,6 @@ using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Platform;
using osu.Game.Beatmaps;
using osu.Game.Database;
using osu.Game.IO.Archives;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Rulesets.Mods;
@@ -162,7 +161,7 @@ namespace osu.Game.Tests.Scores.IO
var scoreManager = osu.Dependencies.Get<ScoreManager>();
await scoreManager.Import(score, archive);
return scoreManager.Query(_ => true).Detach();
return scoreManager.Query(_ => true);
}
internal class TestArchiveReader : ArchiveReader
@@ -95,7 +95,7 @@ namespace osu.Game.Tests.Visual.UserInterface
imported?.PerformRead(s =>
{
beatmapInfo = s.Beatmaps[0].Detach();
beatmapInfo = s.Beatmaps[0];
for (int i = 0; i < 50; i++)
{
+1 -1
View File
@@ -188,7 +188,7 @@ namespace osu.Game.Beatmaps
public int BeatmapVersion;
public BeatmapInfo Clone() => (BeatmapInfo)this.Detach().MemberwiseClone();
public BeatmapInfo Clone() => (BeatmapInfo)MemberwiseClone();
public override string ToString() => this.GetDisplayTitle();
-1
View File
@@ -84,7 +84,6 @@ namespace osu.Game.Beatmaps
if (working != null)
return working;
// TODO: FUCK THE WORLD :D
beatmapInfo = beatmapInfo.Detach();
workingCache.Add(working = new BeatmapManagerWorkingBeatmap(beatmapInfo, this));
+1 -3
View File
@@ -682,9 +682,7 @@ namespace osu.Game.Screens.Select
if (beatmapSet.Beatmaps.All(b => b.Hidden))
return null;
// TODO: FUCK THE WORLD :D
if (beatmapSet.IsManaged)
beatmapSet = beatmapSet.Detach();
beatmapSet = beatmapSet.Detach();
var set = new CarouselBeatmapSet(beatmapSet)
{