Use Array.Find and List.Find instead of LINQ's FirstOrDefault
This commit is contained in:
@@ -206,7 +206,7 @@ namespace OpenRA.Mods.Common.Lint
|
|||||||
if (translatables.ContainsKey(nodeType))
|
if (translatables.ContainsKey(nodeType))
|
||||||
{
|
{
|
||||||
var childType = childNode.Key.Split('@')[0];
|
var childType = childNode.Key.Split('@')[0];
|
||||||
var field = translatables[nodeType].FirstOrDefault(t => t.Name == childType);
|
var field = Array.Find(translatables[nodeType], t => t.Name == childType);
|
||||||
if (field.Name == null)
|
if (field.Name == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|||||||
@@ -505,7 +505,7 @@ namespace OpenRA.Mods.D2k.UtilityCommands
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get the first tileset template that contains the Frame ID of the original map's tile with the requested index
|
// Get the first tileset template that contains the Frame ID of the original map's tile with the requested index
|
||||||
var template = tileSetsFromYaml.FirstOrDefault(x => ((DefaultTerrainTemplateInfo)x).Frames.Contains(tileIndex));
|
var template = tileSetsFromYaml.Find(x => ((DefaultTerrainTemplateInfo)x).Frames.Contains(tileIndex));
|
||||||
|
|
||||||
// HACK: The arrakis.yaml tileset file seems to be missing some tiles, so just get a replacement for them
|
// HACK: The arrakis.yaml tileset file seems to be missing some tiles, so just get a replacement for them
|
||||||
// Also used for duplicate tiles that are taken from only tileset
|
// Also used for duplicate tiles that are taken from only tileset
|
||||||
|
|||||||
Reference in New Issue
Block a user