System.Web.Caching.CacheItemPriorityQueue.BubbleUp C# (CSharp) Method

BubbleUp() private method

private BubbleUp ( System.Web.Caching.CacheItem heap ) : void
heap System.Web.Caching.CacheItem
return void
		void BubbleUp (CacheItem[] heap)
		{
			int index, parentIndex;
			CacheItem parent, item;
			
			if (heapCount <= 1)
				return;
			
			index = heapCount - 1;
			parentIndex = (index - 1) >> 1;

			item = heap [index];
			while (index > 0) {
				parent = heap [parentIndex];
				if (heap [index].ExpiresAt >= parent.ExpiresAt)
					break;
				
				heap [index] = parent;
				index = parentIndex;
				parentIndex = (index - 1) >> 1;
			}

			heap [index] = item;
		}
	}