diff --git a/osu.Game.Rulesets.Mania/MathUtils/LegacySortHelper.cs b/osu.Game.Rulesets.Mania/MathUtils/LegacySortHelper.cs index a0e2958bae..5c595323c3 100644 --- a/osu.Game.Rulesets.Mania/MathUtils/LegacySortHelper.cs +++ b/osu.Game.Rulesets.Mania/MathUtils/LegacySortHelper.cs @@ -62,9 +62,7 @@ namespace osu.Game.Rulesets.Mania.MathUtils if (i < j) { - T key = keys[i]; - keys[i] = keys[j]; - keys[j] = key; + (keys[i], keys[j]) = (keys[j], keys[i]); } i++; @@ -142,11 +140,7 @@ namespace osu.Game.Rulesets.Mania.MathUtils private static void swap(T[] a, int i, int j) { if (i != j) - { - T t = a[i]; - a[i] = a[j]; - a[j] = t; - } + (a[i], a[j]) = (a[j], a[i]); } private static void swapIfGreater(T[] keys, IComparer comparer, int a, int b) @@ -154,11 +148,7 @@ namespace osu.Game.Rulesets.Mania.MathUtils if (a != b) { if (comparer.Compare(keys[a], keys[b]) > 0) - { - T key = keys[a]; - keys[a] = keys[b]; - keys[b] = key; - } + (keys[a], keys[b]) = (keys[b], keys[a]); } } } diff --git a/osu.Game.Rulesets.Taiko.Tests/TestSceneSampleOutput.cs b/osu.Game.Rulesets.Taiko.Tests/TestSceneSampleOutput.cs index 97c8d9eeb5..e5c9358c26 100644 --- a/osu.Game.Rulesets.Taiko.Tests/TestSceneSampleOutput.cs +++ b/osu.Game.Rulesets.Taiko.Tests/TestSceneSampleOutput.cs @@ -20,7 +20,7 @@ namespace osu.Game.Rulesets.Taiko.Tests { base.SetUpSteps(); - string[] expectedSampleNames = new[] + string[] expectedSampleNames = { string.Empty, string.Empty, @@ -31,6 +31,7 @@ namespace osu.Game.Rulesets.Taiko.Tests HitSampleInfo.HIT_WHISTLE, HitSampleInfo.HIT_WHISTLE, }; + var actualSampleNames = new List(); // due to pooling we can't access all samples right away due to object re-use, diff --git a/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiSpectatorScreen.cs b/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiSpectatorScreen.cs index 8d878b993c..7ff8c82145 100644 --- a/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiSpectatorScreen.cs +++ b/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiSpectatorScreen.cs @@ -289,7 +289,7 @@ namespace osu.Game.Tests.Visual.Multiplayer [Test] public void TestSpectatingDuringGameplay() { - int[] players = new[] { PLAYER_1_ID, PLAYER_2_ID }; + int[] players = { PLAYER_1_ID, PLAYER_2_ID }; start(players); sendFrames(players, 300); diff --git a/osu.Game/Database/RealmContextFactory.cs b/osu.Game/Database/RealmContextFactory.cs index ffb1c96261..013a2e9d64 100644 --- a/osu.Game/Database/RealmContextFactory.cs +++ b/osu.Game/Database/RealmContextFactory.cs @@ -156,7 +156,7 @@ namespace osu.Game.Database void convertOnlineIDs() where T : RealmObject { - string? className = typeof(T).Name.Replace(@"Realm", string.Empty); + string className = typeof(T).Name.Replace(@"Realm", string.Empty); // version was not bumped when the beatmap/ruleset models were added // therefore we must manually check for their presence to avoid throwing on the `DynamicApi` calls. diff --git a/osu.Game/Online/Chat/MessageFormatter.cs b/osu.Game/Online/Chat/MessageFormatter.cs index 5a90638dcd..5e0f66443b 100644 --- a/osu.Game/Online/Chat/MessageFormatter.cs +++ b/osu.Game/Online/Chat/MessageFormatter.cs @@ -136,7 +136,7 @@ namespace osu.Game.Online.Chat // length > 3 since all these links need another argument to work if (args.Length > 3 && args[1].EndsWith(websiteRootUrl, StringComparison.OrdinalIgnoreCase)) { - string? mainArg = args[3]; + string mainArg = args[3]; switch (args[2]) { diff --git a/osu.Game/Stores/RealmRulesetStore.cs b/osu.Game/Stores/RealmRulesetStore.cs index eea9acea05..e9c04f652d 100644 --- a/osu.Game/Stores/RealmRulesetStore.cs +++ b/osu.Game/Stores/RealmRulesetStore.cs @@ -201,7 +201,7 @@ namespace osu.Game.Stores { try { - string[]? files = Directory.GetFiles(RuntimeInfo.StartupDirectory, @$"{ruleset_library_prefix}.*.dll"); + string[] files = Directory.GetFiles(RuntimeInfo.StartupDirectory, @$"{ruleset_library_prefix}.*.dll"); foreach (string file in files.Where(f => !Path.GetFileName(f).Contains("Tests"))) loadRulesetFromFile(file);