예제 #1
0
		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);
			}
		}
예제 #2
0
        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);
            }
        }
예제 #3
0
		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);
		}
예제 #4
0
        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);
        }