Skip to content

Latest commit

 

History

History
15 lines (11 loc) · 390 Bytes

InternMap.md

File metadata and controls

15 lines (11 loc) · 390 Bytes

InternMap

The InternMap class provides the canonical value object corresponding to the specified key. An example:

var map = new InternMap<int, string>(i => i.ToString());
var s1 = map.Intern(123);
var s2 = map.Intern(123);

where s1 and s2 refer the same object.

This class has the ConcurrentDictionary class and just wraps its GetOrAdd methods.