diff options
author | win7-7 <win7-7@users.noreply.github.com> | 2019-07-07 20:02:35 +0300 |
---|---|---|
committer | win7-7 <win7-7@users.noreply.github.com> | 2019-07-07 20:02:35 +0300 |
commit | 5620aa7cb0eb2bf05463c84d814117bba65e2891 (patch) | |
tree | b261d3ebf81531e7f4b18a4ea560f014756d6720 /layout | |
parent | 516e476e5bfc2d8d15e50a6d17e24238ccfd8563 (diff) | |
download | uxp-5620aa7cb0eb2bf05463c84d814117bba65e2891.tar.gz |
Avoid multiple hashtable lookups in DisplayItemData destructor
UXP has:
MOZ_RELEASE_ASSERT(sAliveDisplayItemDatas && sAliveDisplayItemDatas >Contains(this));
sAliveDisplayItemDatas->RemoveEntry(this);
and this gets hit during frame destruction.
Combine these checks.
Diffstat (limited to 'layout')
-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 e87d9dc09e..934d108e0b 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; |