Exemplo n.º 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);
			}
		}
Exemplo n.º 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);
            }
        }
Exemplo n.º 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);
		}
Exemplo n.º 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);
        }