From f794cf69f94bc56db2dcf0d09974b17a9d24f4d1 Mon Sep 17 00:00:00 2001 From: RoosterDragon Date: Sun, 11 Jun 2023 20:24:15 +0100 Subject: [PATCH] In TypeDictionary.TrimExcess, also TrimExcess on the internal data dictionary size. As TypeDictionary instances tend to live a long time without edits after being initially populated, this will reduce their long term memory footprint. --- OpenRA.Game/Primitives/TypeDictionary.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/OpenRA.Game/Primitives/TypeDictionary.cs b/OpenRA.Game/Primitives/TypeDictionary.cs index 4adcff58c8..52560f8f61 100644 --- a/OpenRA.Game/Primitives/TypeDictionary.cs +++ b/OpenRA.Game/Primitives/TypeDictionary.cs @@ -101,6 +101,7 @@ namespace OpenRA.Primitives public void TrimExcess() { + data.TrimExcess(); foreach (var objs in data.Values) objs.TrimExcess(); }