Multiton pattern: Difference between revisions

Content deleted Content added
m Shortened the longest line, so that the code fits better on narrow screens.
C#: Fix implementation to avoid creating multiple instance of FooMultiton for the same key
Line 87:
public static FooMultiton GetInstance(object key)
{
return _instances.TryAddGetOrAdd(key, (k) => new FooMultiton());
return _instances[key];
}
}