Changed MiniYaml.NodesDict property into a method.
Method is now called ToDictionary. - Cached a few invocations into locals which should prevent some redundant evaluation. - Added ToDictionary overloads that take projection functions for the keys and elements, since several callsites were doing a subsequent Linq.ToDictionary call to get this.
This commit is contained in:
@@ -34,10 +34,11 @@ namespace OpenRA
|
||||
continue;
|
||||
|
||||
var yaml = new MiniYaml(null, MiniYaml.FromFile(yamlPath));
|
||||
if (!yaml.NodesDict.ContainsKey("Metadata"))
|
||||
var nd = yaml.ToDictionary();
|
||||
if (!nd.ContainsKey("Metadata"))
|
||||
continue;
|
||||
|
||||
var mod = FieldLoader.Load<ModMetadata>(yaml.NodesDict["Metadata"]);
|
||||
var mod = FieldLoader.Load<ModMetadata>(nd["Metadata"]);
|
||||
mod.Id = m;
|
||||
|
||||
ret.Add(m, mod);
|
||||
|
||||
Reference in New Issue
Block a user