Add TrimExcess to TypeDictionary.

After adding is finished, this can be used to reduce the memory footprint of the dictionary.
This commit is contained in:
RoosterDragon
2018-03-10 16:27:08 +00:00
committed by abcdefg30
parent e17ede34ef
commit d0f7511a62
3 changed files with 11 additions and 0 deletions

View File

@@ -51,6 +51,8 @@ namespace OpenRA
throw new YamlException(e.Message);
}
}
traits.TrimExcess();
}
catch (YamlException e)
{
@@ -63,6 +65,7 @@ namespace OpenRA
Name = name;
foreach (var t in traitInfos)
traits.Add(t);
traits.TrimExcess();
}
static ITraitInfo LoadTraitInfo(ObjectCreator creator, string traitName, MiniYaml my)