зеркало из https://github.com/mozilla/pjs.git
Adding RemoveAndDelete() to nsObjectHashtable
This commit is contained in:
Родитель
78a8360acd
Коммит
16a59c22db
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче