mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-16 22:04:36 +00:00
Bug 1699098 - Avoid double hashtable lookup in generated RemoveManagee code. r=ipc-reviewers,jld
Differential Revision: https://phabricator.services.mozilla.com/D108768
This commit is contained in:
parent
80fd24eaab
commit
43b7a1eb09
@ -4321,14 +4321,9 @@ class _GenerateProtocolActorCode(ipdl.ast.Visitor):
|
|||||||
"""
|
"""
|
||||||
{
|
{
|
||||||
${manageecxxtype} actor = static_cast<${manageecxxtype}>(aListener);
|
${manageecxxtype} actor = static_cast<${manageecxxtype}>(aListener);
|
||||||
auto& container = ${container};
|
|
||||||
|
|
||||||
// Use a temporary variable here so all the assertion expressions
|
const bool removed = ${container}.EnsureRemoved(actor);
|
||||||
// in the MOZ_RELEASE_ASSERT call below are textually identical;
|
MOZ_RELEASE_ASSERT(removed, "actor not managed by this!");
|
||||||
// the linker can then merge the strings from the assertion macro(s).
|
|
||||||
MOZ_RELEASE_ASSERT(container.Contains(actor),
|
|
||||||
"actor not managed by this!");
|
|
||||||
container.RemoveEntry(actor);
|
|
||||||
|
|
||||||
auto* proxy = actor->GetLifecycleProxy();
|
auto* proxy = actor->GetLifecycleProxy();
|
||||||
NS_IF_RELEASE(proxy);
|
NS_IF_RELEASE(proxy);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user