Closed Bug 1361747 Opened 3 years ago Closed 3 years ago
Avoid a double hashtable lookup for insertions in ns
Frame Message Manager::Add Message Listener and ns Frame Message Manager::Add Weak Message Listener
We can use the API added in bug 1359848 to be a bit smarter here.
Attachment #8864179 - Flags: review?(michael) → review+
Hmm... So what Nathan asked me to do in bug 1361744 makes this patch *really* difficult to write, since here we need to deref the result of LookupForAdd both in the else branch and after the if branch, and there is no single good place to deref the EntryPtr and assign its return value to a return value. So I'd either have to do that both in the else branch and after the if, or convert the -> operators to |(*listeners).Length()| and the like. None of these options seem all that good. I think I'll have to wait for the OrInsert() idea from bug 1361745. I now wonder if Nathan's suggestion in bug 1361744 was a good one, but this doesn't seem worthy of a long debate. :/
Attachment #8865075 - Flags: review?(michael) → review+
Pushed by email@example.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/5fa6bc617e2f Avoid a double hashtable lookup for insertions in nsFrameMessageManager::AddMessageListener and nsFrameMessageManager::AddWeakMessageListener; r=mystor
You need to log in before you can comment on or make changes to this bug.