Fixed TraitDictionary.Contains to use Any() rather than Count() != 0.

This means it can bail early if a match is found.
This commit is contained in:
RoosterDragon
2014-05-21 20:14:26 +01:00
parent db08357e36
commit da6b5c1ce4

View File

@@ -85,7 +85,7 @@ namespace OpenRA
public bool Contains<T>(Actor actor)
{
CheckDestroyed(actor);
return ((TraitContainer<T>)InnerGet(typeof(T))).GetMultiple(actor.ActorID).Count() != 0;
return ((TraitContainer<T>)InnerGet(typeof(T))).GetMultiple(actor.ActorID).Any();
}
public T Get<T>(Actor actor)