filesystem: Fix benign use of loop variable in closure

This closure never outlives a single loop iteration.
This commit is contained in:
Chris Forbes
2014-10-07 18:17:09 +13:00
parent f61b52ccae
commit edbd65bdf3

View File

@@ -199,13 +199,14 @@ namespace OpenRA.FileSystem
foreach (var ext in exts)
{
var possibleName = filename + ext;
var folder = MountedFolders
.Where(x => x.Exists(filename + ext))
.Where(x => x.Exists(possibleName))
.MaxByOrDefault(x => x.Priority);
if (folder != null)
{
s = folder.GetContent(filename + ext);
s = folder.GetContent(possibleName);
return true;
}
}