Use Array.Exists and List.Exists instead of LINQ's Any

This commit is contained in:
abcdefg30
2023-10-30 16:12:03 +01:00
committed by Gustas
parent fc0bdce151
commit 7baae40b2d

View File

@@ -52,7 +52,7 @@ namespace OpenRA.WindowsLauncher
}
}
if (args.Any(x => x.StartsWith("Engine.LaunchPath=", StringComparison.Ordinal)))
if (Array.Exists(args, x => x.StartsWith("Engine.LaunchPath=", StringComparison.Ordinal)))
return RunGame(args);
return RunInnerLauncher(args);
@@ -89,10 +89,10 @@ namespace OpenRA.WindowsLauncher
var launcherPath = Environment.ProcessPath;
var launcherArgs = args.ToList();
if (!launcherArgs.Any(x => x.StartsWith("Engine.LaunchPath=", StringComparison.Ordinal)))
if (!launcherArgs.Exists(x => x.StartsWith("Engine.LaunchPath=", StringComparison.Ordinal)))
launcherArgs.Add("Engine.LaunchPath=\"" + launcherPath + "\"");
if (!launcherArgs.Any(x => x.StartsWith("Game.Mod=", StringComparison.Ordinal)))
if (!launcherArgs.Exists(x => x.StartsWith("Game.Mod=", StringComparison.Ordinal)))
launcherArgs.Add("Game.Mod=" + modID);
var psi = new ProcessStartInfo(launcherPath, string.Join(" ", launcherArgs));