Less aggressive rules caching
ActorInfo instances depend on the whole set of ActorInfos
This commit is contained in:
@@ -94,13 +94,15 @@ namespace OpenRA
|
|||||||
string[] files, List<MiniYamlNode> nodes,
|
string[] files, List<MiniYamlNode> nodes,
|
||||||
Func<MiniYamlNode, Dictionary<string, MiniYaml>, T> f)
|
Func<MiniYamlNode, Dictionary<string, MiniYaml>, T> f)
|
||||||
{
|
{
|
||||||
|
string inputKey = string.Concat(string.Join("|", files), "|", nodes.WriteToString());
|
||||||
|
|
||||||
var mergedNodes = files
|
var mergedNodes = files
|
||||||
.Select(s => MiniYaml.FromFile(s))
|
.Select(s => MiniYaml.FromFile(s))
|
||||||
.Aggregate(nodes, MiniYaml.MergeLiberal);
|
.Aggregate(nodes, MiniYaml.MergeLiberal);
|
||||||
|
|
||||||
Func<MiniYamlNode, Dictionary<string, MiniYaml>, T> wrap = (wkv, wyy) =>
|
Func<MiniYamlNode, Dictionary<string, MiniYaml>, T> wrap = (wkv, wyy) =>
|
||||||
{
|
{
|
||||||
var key = wkv.Value.ToLines(wkv.Key).JoinWith("|");
|
var key = inputKey + wkv.Value.ToLines(wkv.Key).JoinWith("|");
|
||||||
T t;
|
T t;
|
||||||
if (itemCache.TryGetValue(key, out t))
|
if (itemCache.TryGetValue(key, out t))
|
||||||
return t;
|
return t;
|
||||||
|
|||||||
Reference in New Issue
Block a user