Exemplo n.º 1
0
        public T Remove(PoolLinkedListElement <T> element)
        {
            var value = element.Value;

            if (element.Previous != null)
            {
                element.Previous.Next = element.Next;
            }
            if (element.Next != null)
            {
                element.Next.Previous = element.Previous;
            }
            if (First == element)
            {
                First = element.Next;
            }
            if (Last == element)
            {
                Last = element.Previous;
            }
            RecycleElement(element);
            Count -= 1;
            return(value);
        }
Exemplo n.º 2
0
 private void RecycleElement(PoolLinkedListElement <T> element)
 {
     ObjectPool <PoolLinkedListElement <T> > .Recycle(element);
 }