public void Remove (MemoryCacheEntry entry) { if (entry == null) return; int hash = entry.GetHashCode (); LinkedListNode <MemoryCacheEntry> node; if (index.TryGetValue (hash, out node)) { lru.Remove (node); index.Remove (hash); } }
public void Remove(MemoryCacheEntry entry) { if (entry == null) { return; } int hash = entry.GetHashCode(); LinkedListNode <MemoryCacheEntry> node; if (index.TryGetValue(hash, out node)) { lru.Remove(node); index.Remove(hash); } }
public void Update (MemoryCacheEntry entry) { if (entry == null) return; int hash = entry.GetHashCode (); LinkedListNode <MemoryCacheEntry> node; if (!index.TryGetValue (hash, out node)) { node = new LinkedListNode <MemoryCacheEntry> (entry); index.Add (hash, node); } else { lru.Remove (node); node.Value = entry; } lru.AddLast (node); }
public void Update(MemoryCacheEntry entry) { if (entry == null) { return; } int hash = entry.GetHashCode(); LinkedListNode <MemoryCacheEntry> node; if (!index.TryGetValue(hash, out node)) { node = new LinkedListNode <MemoryCacheEntry> (entry); index.Add(hash, node); } else { lru.Remove(node); node.Value = entry; } lru.AddLast(node); }