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:
@@ -88,7 +88,11 @@ namespace OpenRA.Editor
|
||||
foreach (var init in Program.Rules.Actors[kv.Value.Type].GetInitKeys())
|
||||
apd.AddRow(init.First,
|
||||
apd.MakeEditorControl(init.Second,
|
||||
() => objSaved.NodesDict.ContainsKey(init.First) ? objSaved.NodesDict[init.First].Value : null,
|
||||
() =>
|
||||
{
|
||||
var nodesDict = objSaved.ToDictionary();
|
||||
return nodesDict.ContainsKey(init.First) ? nodesDict[init.First].Value : null;
|
||||
},
|
||||
_ => { }));
|
||||
|
||||
apd.ShowDialog();
|
||||
|
||||
Reference in New Issue
Block a user