private Participant Get(string key, ClockCache <string, Participant> cache, Func <string, Participant> lookupFunc) { Participant retval; if (!cache.TryGetValue(key, out retval)) { var id = lookupFunc(key); if (id != null) { retval = id; CacheIdentity(id, key); } } return(retval); }
public IdentityCache() { m_identitiesByInput = new ClockCache <string, Participant>(MaximumSize); m_identitiesByAlias = new ClockCache <string, IEnumerable <Participant> >(MaximumSize); }