private Tuple <ManagedGroup <TObject, TKey, TGroupKey>, bool> GetCache(TGroupKey key) { Optional <ManagedGroup <TObject, TKey, TGroupKey> > cache = _groupCache.Lookup(key); if (cache.HasValue) { return(Tuple.Create(cache.Value, false)); } var newcache = new ManagedGroup <TObject, TKey, TGroupKey>(key); _groupCache[key] = newcache; return(Tuple.Create(newcache, true)); }
private bool Equals(ManagedGroup <TObject, TKey, TGroupKey> other) { return(EqualityComparer <TGroupKey> .Default.Equals(_groupKey, other._groupKey)); }