void LinkedList::Remove(void* item)
{
	if (frontNode)
	{
		ListNode* currNode = frontNode;
		do
		{
			if (currNode->GetItem() == item)
			{
				break;
			}
			currNode = currNode->GetNext();
		} while (currNode);
		if (currNode)
		{
			delete currNode;
			numItems--;
			if (numItems == 0)
			{
				frontNode = NULL;
				backNode = NULL;
			}
		}
	}
}
示例#2
0
文件: list.hpp 项目: 0xMF/coreclr
    template <class Type> Type List<Type>::GetAt(LISTNODE pNode)
    {
        ListNode<Type>                *pListNode = (ListNode<Type> *)pNode;

        // Faults if you pass NULL
        _ASSERTE(pNode);

        return pListNode->GetItem();
    }
示例#3
0
文件: list.hpp 项目: 0xMF/coreclr
    template <class Type> Type List<Type>::GetNext(LISTNODE &pNode)
    {
        ListNode<Type> *pListNode = (ListNode<Type> *)pNode;

        // Faults if you pass NULL
        _ASSERTE(pNode);

        Type item = pListNode->GetItem();
        pNode = (LISTNODE)(pListNode->GetNext());

        return item;
    }