summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2019-07-07 18:34:17 +0000
committerGitHub <noreply@github.com>2019-07-07 18:34:17 +0000
commitf168c25c0a58281213f49e5ab72e43cc1a192795 (patch)
treeb261d3ebf81531e7f4b18a4ea560f014756d6720
parent0845614a5eb3f5fafda7f7b82f041d1a8a0ba955 (diff)
parente0598b0ae2c748f1b38759d66e7a759aec04a6b9 (diff)
downloadUXP-f168c25c0a58281213f49e5ab72e43cc1a192795.tar
UXP-f168c25c0a58281213f49e5ab72e43cc1a192795.tar.gz
UXP-f168c25c0a58281213f49e5ab72e43cc1a192795.tar.lz
UXP-f168c25c0a58281213f49e5ab72e43cc1a192795.tar.xz
UXP-f168c25c0a58281213f49e5ab72e43cc1a192795.zip
Merge pull request #1168 from win7-7/DisplayItemData-destructor
Avoid multiple hashtable lookups in DisplayItemData destructor
-rw-r--r--layout/base/FrameLayerBuilder.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/layout/base/FrameLayerBuilder.cpp b/layout/base/FrameLayerBuilder.cpp
index e87d9dc09..934d108e0 100644
--- a/layout/base/FrameLayerBuilder.cpp
+++ b/layout/base/FrameLayerBuilder.cpp
@@ -272,8 +272,13 @@ FrameLayerBuilder::DisplayItemData::~DisplayItemData()
array->RemoveElement(this);
}
- MOZ_RELEASE_ASSERT(sAliveDisplayItemDatas && sAliveDisplayItemDatas->Contains(this));
- sAliveDisplayItemDatas->RemoveEntry(this);
+ MOZ_RELEASE_ASSERT(sAliveDisplayItemDatas);
+ nsPtrHashKey<mozilla::FrameLayerBuilder::DisplayItemData>* entry
+ = sAliveDisplayItemDatas->GetEntry(this);
+ MOZ_RELEASE_ASSERT(entry);
+
+ sAliveDisplayItemDatas->RemoveEntry(entry);
+
if (sAliveDisplayItemDatas->Count() == 0) {
delete sAliveDisplayItemDatas;
sAliveDisplayItemDatas = nullptr;