diff --git a/OpenRA.FileFormats/Primitives/Cache.cs b/OpenRA.FileFormats/Primitives/Cache.cs index ec76e76ecc..7e350a5f74 100644 --- a/OpenRA.FileFormats/Primitives/Cache.cs +++ b/OpenRA.FileFormats/Primitives/Cache.cs @@ -15,17 +15,21 @@ using System.Collections.Generic; namespace OpenRA.FileFormats { public class Cache : IEnumerable> - { - Dictionary hax = new Dictionary(); + { + Dictionary hax; Func loader; - public Cache(Func loader) + public Cache(Func loader, IEqualityComparer c) { + hax = new Dictionary(c); if (loader == null) throw new ArgumentNullException(); this.loader = loader; - } + } + + public Cache(Func loader) + : this(loader, EqualityComparer.Default) { } public U this[T key] {