Make mods IReadOnlyList<Mod> gamewide

Prevents potential multiple evaluations of enumerable.
This commit is contained in:
smoogipoo
2019-04-10 17:13:12 +09:00
parent 7845d542e3
commit 0222424aef
44 changed files with 68 additions and 68 deletions

View File

@ -1,7 +1,7 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Linq;
using System;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
@ -179,7 +179,7 @@ namespace osu.Game.Screens.Multi.Match
{
RoomManager?.PartRoom();
Mods.Value = Enumerable.Empty<Mod>();
Mods.Value = Array.Empty<Mod>();
return base.OnExiting(next);
}
@ -193,7 +193,7 @@ namespace osu.Game.Screens.Multi.Match
var localBeatmap = e.NewValue?.Beatmap == null ? null : beatmapManager.QueryBeatmap(b => b.OnlineBeatmapID == e.NewValue.Beatmap.OnlineBeatmapID);
Beatmap.Value = beatmapManager.GetWorkingBeatmap(localBeatmap);
Mods.Value = e.NewValue?.RequiredMods ?? Enumerable.Empty<Mod>();
Mods.Value = e.NewValue?.RequiredMods?.ToArray() ?? Array.Empty<Mod>();
if (e.NewValue?.Ruleset != null)
Ruleset.Value = e.NewValue.Ruleset;
}