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:
@@ -24,7 +24,7 @@ namespace OpenRA.GameRules
|
||||
{
|
||||
Title = value.Value;
|
||||
|
||||
var nd = value.NodesDict;
|
||||
var nd = value.ToDictionary();
|
||||
var ext = nd.ContainsKey("Extension") ? nd["Extension"].Value : "aud";
|
||||
Filename = (nd.ContainsKey("Filename") ? nd["Filename"].Value : key)+"."+ext;
|
||||
if (!GlobalFileSystem.Exists(Filename))
|
||||
|
||||
Reference in New Issue
Block a user