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(); } }
public bool Equals(WeakCache <TKey, TValue> .Entry other) => ((other != null) && this.key.Equals(other.key));