コード例 #1
0
        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));
        }
コード例 #2
0
 private bool Equals(ManagedGroup <TObject, TKey, TGroupKey> other)
 {
     return(EqualityComparer <TGroupKey> .Default.Equals(_groupKey, other._groupKey));
 }