Beispiel #1
0
 public static void EnsureEmpty <TKey, TValue>(ref WeakCache <TKey, TValue> cache, Func <WeakCache <TKey, TValue> > cacheFactory) where TValue : class
 {
     if (cache == null)
     {
         cache = cacheFactory();
     }
     else
     {
         cache.Clear();
     }
 }
Beispiel #2
0
 public bool Equals(WeakCache <TKey, TValue> .Entry other) =>
 ((other != null) && this.key.Equals(other.key));