Fix CA1851
This commit is contained in:
@@ -271,7 +271,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
||||
if (isActivity)
|
||||
Console.WriteLine(" --- *Queued Activity*");
|
||||
|
||||
if (requiredTraits.Any())
|
||||
if (requiredTraits.Length != 0)
|
||||
Console.WriteLine($" --- **Requires {(requiredTraits.Length == 1 ? "Trait" : "Traits")}:** {requiredTraits.Select(GetDocumentationUrl).JoinWith(", ")}");
|
||||
|
||||
if (memberInfo is MethodInfo methodInfo)
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
||||
if (folder.OpenPackage(args[1], modData.ModFiles) is not IReadWritePackage package)
|
||||
throw new FileNotFoundException(args[1]);
|
||||
|
||||
IEnumerable<UpdateRule> rules = null;
|
||||
IReadOnlyCollection<UpdateRule> rules = null;
|
||||
if (args.Length > 2)
|
||||
rules = UpdatePath.FromSource(modData.ObjectCreator, args[2]);
|
||||
|
||||
@@ -77,9 +77,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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user