Replace arrays with sets.

In places where arrays were being treated as a set, just create a set directly. This reveals the intention of such collections better, and also improves performance by allowing set based methods to be used.
This commit is contained in:
RoosterDragon
2015-09-03 20:09:16 +01:00
parent 4f4bab2cdf
commit 901e604cf3
19 changed files with 43 additions and 38 deletions

View File

@@ -45,10 +45,10 @@ namespace OpenRA.Mods.Common.Lint
continue;
// This warhead cannot affect this actor.
if (!warhead.ValidTargets.Intersect(targetable).Any())
if (!warhead.ValidTargets.Overlaps(targetable))
continue;
if (!warhead.DamageTypes.Intersect(deathTypes).Any())
if (!warhead.DamageTypes.Overlaps(deathTypes))
emitError("Actor type `{0}` does not define a death animation for weapon `{1}`!"
.F(actorInfo.Key, weaponInfo.Key));
}