Use Contains method on Selection when possible.
This allows the set to be utilized for a fast check, rather than degrading to a linear search via LINQ.
This commit is contained in:
@@ -81,7 +81,7 @@ namespace OpenRA.Mods.Common.Effects
|
||||
if (!building.IsInWorld || !building.Owner.IsAlliedWith(building.World.LocalPlayer))
|
||||
return SpriteRenderable.None;
|
||||
|
||||
if (!building.World.Selection.Actors.Contains(building))
|
||||
if (!building.World.Selection.Contains(building))
|
||||
return SpriteRenderable.None;
|
||||
|
||||
return RenderInner(wr);
|
||||
|
||||
Reference in New Issue
Block a user