From 2bd8778c55d1aacd46c79770a5eef0ab9a13447d Mon Sep 17 00:00:00 2001 From: RoosterDragon Date: Wed, 21 May 2014 20:19:39 +0100 Subject: [PATCH] Changed removeActorPosition field in ActorMap into a set. This is because it's purpose is to be queried via Contains when actors needed to be removed. --- OpenRA.Game/Traits/World/ActorMap.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/OpenRA.Game/Traits/World/ActorMap.cs b/OpenRA.Game/Traits/World/ActorMap.cs index 306e70d70a..8b9ab1ee98 100644 --- a/OpenRA.Game/Traits/World/ActorMap.cs +++ b/OpenRA.Game/Traits/World/ActorMap.cs @@ -49,8 +49,8 @@ namespace OpenRA.Traits // Position updates are done in one pass // to ensure consistency during a tick - List addActorPosition; - List removeActorPosition; + readonly List addActorPosition = new List(); + readonly HashSet removeActorPosition = new HashSet(); public ActorMap(World world, ActorMapInfo info) { @@ -64,9 +64,6 @@ namespace OpenRA.Traits for (var j = 0; j < rows; j++) for (var i = 0; i < cols; i++) actors[j * cols + i] = new List(); - - addActorPosition = new List(); - removeActorPosition = new List(); } public IEnumerable GetUnitsAt(CPos a)