Avoid multiple hashtable lookups in DisplayItemData destructor.
This commit is contained in:
parent
d9277ab3ed
commit
594f7f0e19
|
@ -272,8 +272,13 @@ FrameLayerBuilder::DisplayItemData::~DisplayItemData()
|
||||||
array->RemoveElement(this);
|
array->RemoveElement(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
MOZ_RELEASE_ASSERT(sAliveDisplayItemDatas && sAliveDisplayItemDatas->Contains(this));
|
MOZ_RELEASE_ASSERT(sAliveDisplayItemDatas);
|
||||||
sAliveDisplayItemDatas->RemoveEntry(this);
|
nsPtrHashKey<mozilla::FrameLayerBuilder::DisplayItemData>* entry
|
||||||
|
= sAliveDisplayItemDatas->GetEntry(this);
|
||||||
|
MOZ_RELEASE_ASSERT(entry);
|
||||||
|
|
||||||
|
sAliveDisplayItemDatas->RemoveEntry(entry);
|
||||||
|
|
||||||
if (sAliveDisplayItemDatas->Count() == 0) {
|
if (sAliveDisplayItemDatas->Count() == 0) {
|
||||||
delete sAliveDisplayItemDatas;
|
delete sAliveDisplayItemDatas;
|
||||||
sAliveDisplayItemDatas = nullptr;
|
sAliveDisplayItemDatas = nullptr;
|
||||||
|
|
Loading…
Reference in New Issue