From ea475ed39b2d34bf465065f493ff2bdbfd985bfe Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Tue, 7 Oct 2014 18:30:23 +1300 Subject: [PATCH] DomainIndex: Fix benign loop variable in closure hazard This never outlived a single iteration of the neighbors loop. --- OpenRA.Mods.RA/World/DomainIndex.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.RA/World/DomainIndex.cs b/OpenRA.Mods.RA/World/DomainIndex.cs index 9b6704cca2..4e27de07c6 100644 --- a/OpenRA.Mods.RA/World/DomainIndex.cs +++ b/OpenRA.Mods.RA/World/DomainIndex.cs @@ -89,7 +89,8 @@ namespace OpenRA.Mods.RA foreach (var cell in dirtyCells) { // Select all neighbors inside the map boundries - var neighbors = CVec.directions.Select(d => d + cell) + var thisCell = cell; // benign closure hazard + var neighbors = CVec.directions.Select(d => d + thisCell) .Where(c => map.Contains(c)); var found = false;