From da6b5c1ce4b65739c9779db0fe1e1686585a22a2 Mon Sep 17 00:00:00 2001 From: RoosterDragon Date: Wed, 21 May 2014 20:14:26 +0100 Subject: [PATCH] Fixed TraitDictionary.Contains to use Any() rather than Count() != 0. This means it can bail early if a match is found. --- OpenRA.Game/TraitDictionary.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenRA.Game/TraitDictionary.cs b/OpenRA.Game/TraitDictionary.cs index a9389e2202..f69fc6e1f2 100755 --- a/OpenRA.Game/TraitDictionary.cs +++ b/OpenRA.Game/TraitDictionary.cs @@ -85,7 +85,7 @@ namespace OpenRA public bool Contains(Actor actor) { CheckDestroyed(actor); - return ((TraitContainer)InnerGet(typeof(T))).GetMultiple(actor.ActorID).Count() != 0; + return ((TraitContainer)InnerGet(typeof(T))).GetMultiple(actor.ActorID).Any(); } public T Get(Actor actor)