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:
@@ -85,7 +85,7 @@ namespace OpenRA
|
|||||||
public bool Contains<T>(Actor actor)
|
public bool Contains<T>(Actor actor)
|
||||||
{
|
{
|
||||||
CheckDestroyed(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)
|
public T Get<T>(Actor actor)
|
||||||
|
|||||||
Reference in New Issue
Block a user