mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Use conditional nullability attribute
As it turns out, C# 8 provides an attribute that allows annotating that an `out` parameter's nullability depends on the method's return value, which is exactly what is desired here.
This commit is contained in:
@ -92,7 +92,7 @@ namespace osu.Game.Utils
|
||||
/// <param name="mods">The mods to check.</param>
|
||||
/// <param name="invalidMods">Invalid mods, if any were found. Can be null if all mods were valid.</param>
|
||||
/// <returns>Whether the input mods were all valid. If false, <paramref name="invalidMods"/> will contain all invalid entries.</returns>
|
||||
public static bool CheckValidForGameplay(IEnumerable<Mod> mods, out List<Mod>? invalidMods)
|
||||
public static bool CheckValidForGameplay(IEnumerable<Mod> mods, [NotNullWhen(false)] out List<Mod>? invalidMods)
|
||||
{
|
||||
mods = mods.ToArray();
|
||||
|
||||
|
Reference in New Issue
Block a user