Bug 1202526 (part 6) - Use PLDHashTable::RemoveEntry() in XULDocument. r=bz.
authorNicholas Nethercote <nnethercote@mozilla.com>
Mon, 07 Sep 2015 19:20:16 -0700
changeset 294327 38e1c1c1bdc772bc0b06471737ee22b0ff8ba62c
parent 294326 aa827e8bdba208ef2e8b4dcb70600c00d67a4137
child 294328 1ff0bf051b2429470dddf879c647abb57ac4a118
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs1202526
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1202526 (part 6) - Use PLDHashTable::RemoveEntry() in XULDocument. r=bz. This avoids repeating the hash table search in order to remove the entry.
dom/xul/XULDocument.cpp
--- a/dom/xul/XULDocument.cpp
+++ b/dom/xul/XULDocument.cpp
@@ -834,17 +834,17 @@ XULDocument::RemoveBroadcastListenerFor(
             BroadcastListener* bl = entry->mListeners[i];
             nsCOMPtr<Element> blListener = do_QueryReferent(bl->mListener);
 
             if (blListener == &aListener && bl->mAttribute == attr) {
                 entry->mListeners.RemoveElementAt(i);
                 delete bl;
 
                 if (entry->mListeners.IsEmpty())
-                    PL_DHashTableRemove(mBroadcasterMap, &aBroadcaster);
+                    mBroadcasterMap->RemoveEntry(entry);
 
                 break;
             }
         }
     }
 }
 
 nsresult