Less aggressive rules caching

ActorInfo instances depend on the whole set of ActorInfos
This commit is contained in:
Pavlos Touboulidis
2014-05-02 22:05:05 +03:00
parent 693186e1eb
commit c68427eaa6

View File

@@ -94,13 +94,15 @@ namespace OpenRA
string[] files, List<MiniYamlNode> nodes,
Func<MiniYamlNode, Dictionary<string, MiniYaml>, T> f)
{
string inputKey = string.Concat(string.Join("|", files), "|", nodes.WriteToString());
var mergedNodes = files
.Select(s => MiniYaml.FromFile(s))
.Aggregate(nodes, MiniYaml.MergeLiberal);
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;
if (itemCache.TryGetValue(key, out t))
return t;