.Any(), .Count() -> .Count or .Length

This commit is contained in:
Eduardo Cáceres
2022-05-02 13:05:22 +02:00
committed by atlimit8
parent 6eb4fe8980
commit 79f321cb44
138 changed files with 233 additions and 258 deletions

View File

@@ -45,7 +45,7 @@ namespace OpenRA.Mods.Common.Traits
{
this.self = self;
this.info = info;
if (!info.Units.Any())
if (info.Units.Length == 0)
throw new YamlException("A GiveUnitCrateAction does not specify any units to give. This might be because the yaml is referring to 'Unit' rather than 'Units'.");
}
@@ -54,7 +54,7 @@ namespace OpenRA.Mods.Common.Traits
if (collector.Owner.NonCombatant)
return false;
if (info.ValidFactions.Any() && !info.ValidFactions.Contains(collector.Owner.Faction.InternalName))
if (info.ValidFactions.Count > 0 && !info.ValidFactions.Contains(collector.Owner.Faction.InternalName))
return false;
foreach (var unit in info.Units)