Adding RemoveAndDelete() to nsObjectHashtable

This commit is contained in:
dp%netscape.com 1999-08-02 23:55:03 +00:00
Родитель 78a8360acd
Коммит 16a59c22db
2 изменённых файлов: 13 добавлений и 0 удалений

Просмотреть файл

@ -356,6 +356,18 @@ nsObjectHashtable::Reset()
nsHashtable::Reset(mDestroyElementFun, mDestroyElementClosure);
}
PRBool
nsObjectHashtable::RemoveAndDelete(nsHashKey *aKey)
{
void *value = Remove(aKey);
if (value && mDestroyElementFun)
{
return (*mDestroyElementFun)(aKey, value, mDestroyElementClosure);
}
else
return PR_FALSE;
}
////////////////////////////////////////////////////////////////////////////////
// nsSupportsHashtable: an nsHashtable where the elements are nsISupports*

Просмотреть файл

@ -75,6 +75,7 @@ public:
nsHashtable *Clone();
void Reset();
PRBool RemoveAndDelete(nsHashKey *aKey);
protected:
static PR_CALLBACK PRIntn CopyElement(PLHashEntry *he, PRIntn i, void *arg);