We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 516efa1 commit 8d1a69eCopy full SHA for 8d1a69e
OpenRA.FileFormats/Primitives/Cache.cs
@@ -15,17 +15,21 @@
15
namespace OpenRA.FileFormats
16
{
17
public class Cache<T, U> : IEnumerable<KeyValuePair<T, U>>
18
- {
19
- Dictionary<T, U> hax = new Dictionary<T, U>();
+ {
+ Dictionary<T, U> hax;
20
Func<T,U> loader;
21
22
- public Cache(Func<T,U> loader)
+ public Cache(Func<T,U> loader, IEqualityComparer<T> c)
23
24
+ hax = new Dictionary<T, U>(c);
25
if (loader == null)
26
throw new ArgumentNullException();
27
28
this.loader = loader;
- }
29
+ }
30
+
31
+ public Cache(Func<T, U> loader)
32
+ : this(loader, EqualityComparer<T>.Default) { }
33
34
public U this[T key]
35
0 commit comments