Bug 1202526 (part 4) - Avoid PL_DHashTableRawRemove() in nsPropertyTable. r=bz.

This assumes that it's safe to possibly shrink the table after the removal,
i.e. there are no surprising subtleties with how this table is managed.
This commit is contained in:
Nicholas Nethercote 2015-09-07 19:20:16 -07:00
Родитель 9a0ec7b3f4
Коммит dc1d9c7902
1 изменённых файлов: 3 добавлений и 3 удалений

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

@ -107,7 +107,7 @@ nsPropertyTable::TransferOrDeleteAllPropertiesFor(nsPropertyOwner aObject,
break;
}
PL_DHashTableRawRemove(&prop->mObjectValueMap, entry);
prop->mObjectValueMap.RemoveEntry(entry);
}
}
else {
@ -164,7 +164,7 @@ nsPropertyTable::GetPropertyInternal(nsPropertyOwner aObject,
propValue = entry->value;
if (aRemove) {
// don't call propertyList->mDtorFunc. That's the caller's job now.
PL_DHashTableRawRemove(&propertyList->mObjectValueMap, entry);
propertyList->mObjectValueMap.RemoveEntry(entry);
}
rv = NS_OK;
}
@ -301,7 +301,7 @@ nsPropertyTable::PropertyList::DeletePropertyFor(nsPropertyOwner aObject)
return false;
void* value = entry->value;
PL_DHashTableRawRemove(&mObjectValueMap, entry);
mObjectValueMap.RemoveEntry(entry);
if (mDtorFunc)
mDtorFunc(const_cast<void*>(aObject.get()), mName, value, mDtorData);