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:
@@ -80,7 +80,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (Info.UseDeathTypeSuffix)
|
||||
{
|
||||
var warhead = e.Warhead as DamageWarhead;
|
||||
var damageType = warhead.DamageTypes.Intersect(Info.DeathTypes.Keys).FirstOrDefault();
|
||||
var damageType = Info.DeathTypes.Keys.FirstOrDefault(warhead.DamageTypes.Contains);
|
||||
if (damageType == null)
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user