public virtual void RemoveItem(T item) { CAssert.Greater(m_size, 0); CAssert.AreSame(this, item.m_list); CFastListNode prev = item.m_listPrev; CFastListNode next = item.m_listNext; if (prev != null) { prev.m_listNext = next; } else { m_listFirst = next; } if (next != null) { next.m_listPrev = prev; } else { m_listLast = prev; } item.m_listNext = item.m_listPrev = null; item.m_list = null; --m_size; }
private void RemoveTimer(CTimer timer) { CAssert.AreSame(this, timer.manager); CAssert.Greater(timersCount, 0); --timersCount; CTimer prev = timer.prev; CTimer next = timer.next; if (prev != null) { prev.next = next; } else { rootTimer = next; } if (next != null) { next.prev = prev; } }