Replace some Where-FirstOrDefault chains with a single call to FirstOrDefault

This commit is contained in:
ScottNZ
2013-11-11 21:20:19 +13:00
parent 9643609c31
commit 7c5f3cc0f1
8 changed files with 9 additions and 10 deletions

View File

@@ -700,7 +700,7 @@ namespace OpenRA.Editor
{
int imageLength = 0;
int type = surface1.Map.MapResources.Value[x, y].Type;
var template = surface1.ResourceTemplates.Where(a => a.Value.Info.ResourceType == type).FirstOrDefault().Value;
var template = surface1.ResourceTemplates.FirstOrDefault(a => a.Value.Info.ResourceType == type).Value;
if (type == 1)
imageLength = 12;
else if (type == 2)