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:
@@ -44,7 +44,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (warhead == null)
|
||||
return;
|
||||
|
||||
if (info.DeathTypes.Intersect(warhead.DamageTypes).Any())
|
||||
if (warhead.DamageTypes.Overlaps(info.DeathTypes))
|
||||
self.PlayVoiceLocal(info.Voice, info.VolumeMultiplier);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user