Remove(nsIRDFResource* aResource, nsIContent* aContent) { NS_PRECONDITION(mResources != nsnull, "not initialized"); if (! mResources) return NS_ERROR_NOT_INITIALIZED;
nsElementMap::Remove(nsIRDFResource* aResource, nsIContent* aContent) { NS_PRECONDITION(mResources != nsnull, "not initialized"); if (! mResources) return NS_ERROR_NOT_INITIALIZED;
    Remove(nsIRDFResource* aResource, nsIContent* aContent)    {        NS_PRECONDITION(mResources != nsnull, "not initialized");        if (! mResources)            return NS_ERROR_NOT_INITIALIZED;        ContentListItem* head =            (ContentListItem*) PL_HashTableLookup(mResources, aResource);        if (head) {            if (head->mContent == aContent) {                ContentListItem* newHead = head->mNext;                if (newHead) {                    PL_HashTableAdd(mResources, aResource, newHead);                }                else {                    PL_HashTableRemove(mResources, aResource);                }                delete head;                return NS_OK;            }            else {                ContentListItem* doomed = head->mNext;                while (doomed) {                    if (doomed->mContent == aContent) {                        head->mNext = doomed->mNext;                        delete doomed;                        return NS_OK;                    }                    head = doomed;                    doomed = doomed->mNext;                }            }        }        // XXX Don't comment out this assert: if you get here,        // something has gone dreadfully, horribly        // wrong. Curse. Scream. File a bug against        // waterson@netscape.com.        NS_ERROR("attempt to remove an element that was never added");        return NS_ERROR_ILLEGAL_VALUE;    }