Fix CA1851

This commit is contained in:
RoosterDragon
2023-07-13 20:08:36 +01:00
committed by abcdefg30
parent 88f830a9e5
commit 3275875ae5
63 changed files with 349 additions and 267 deletions

View File

@@ -32,7 +32,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
// HACK: The engine code assumes that Game.modData is set.
var modData = Game.ModData = utility.ModData;
IEnumerable<UpdateRule> rules = null;
IReadOnlyCollection<UpdateRule> rules = null;
if (args.Length > 1)
rules = UpdatePath.FromSource(modData.ObjectCreator, args[1]);
@@ -71,9 +71,10 @@ namespace OpenRA.Mods.Common.UtilityCommands
}
var other = UpdatePath.KnownRules(modData.ObjectCreator)
.Where(r => !ruleGroups.Values.Any(g => g.Contains(r)));
.Where(r => !ruleGroups.Values.Any(g => g.Contains(r)))
.ToList();
if (other.Any())
if (other.Count != 0)
{
Console.WriteLine(" Other:");
foreach (var r in other)
@@ -111,9 +112,9 @@ namespace OpenRA.Mods.Common.UtilityCommands
PrintSummary(rules, args.Contains("--detailed"));
}
public static void PrintSummary(IEnumerable<UpdateRule> rules, bool detailed)
public static void PrintSummary(IReadOnlyCollection<UpdateRule> rules, bool detailed)
{
var count = rules.Count();
var count = rules.Count;
if (count == 1)
Console.WriteLine("Found 1 API change:");
else