public void Clear() { var head = this.head; while (head != null) { ActiveListNode <T> node2 = head; node2.Invalidate(); head = head.Next; } this.head = null; this.count = 0; }
private void RemoveNode(ActiveListNode <T> node) { if (node.next != null) { node.next.prev = node.prev; } if (node.prev != null) { node.prev.next = node.next; } node.Invalidate(); if (this.head == node) { this.head = node.next; } if (this.tail == node) { this.tail = node.prev; } --this.count; ++version; }