示例#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);
        }