diff options
author | Moonchild <moonchild@palemoon.org> | 2019-07-07 18:34:17 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-07 18:34:17 +0000 |
commit | f168c25c0a58281213f49e5ab72e43cc1a192795 (patch) | |
tree | b261d3ebf81531e7f4b18a4ea560f014756d6720 | |
parent | 0845614a5eb3f5fafda7f7b82f041d1a8a0ba955 (diff) | |
parent | e0598b0ae2c748f1b38759d66e7a759aec04a6b9 (diff) | |
download | UXP-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.cpp | 9 |
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; |