зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1372413 - Use RemoveEntry(EntryType*) instead of RemoveEntry(KeyType) to avoid another hashtable lookup. r=mak
MozReview-Commit-ID: 1isuxbPXV94
This commit is contained in:
Родитель
185a60c094
Коммит
3d62b7ca50
|
@ -2548,7 +2548,8 @@ History::RegisterVisitedCallback(nsIURI* aURI,
|
|||
// assumes that aLink is non-nullptr, we will need to return now.
|
||||
if (NS_FAILED(rv) || !aLink) {
|
||||
// Remove our array from the hashtable so we don't keep it around.
|
||||
mObservers.RemoveEntry(aURI);
|
||||
MOZ_ASSERT(key == mObservers.GetEntry(aURI), "The URIs hash mutated!");
|
||||
mObservers.RemoveEntry(key);
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
|
@ -2598,7 +2599,8 @@ History::UnregisterVisitedCallback(nsIURI* aURI,
|
|||
|
||||
// If the array is now empty, we should remove it from the hashtable.
|
||||
if (observers.IsEmpty()) {
|
||||
mObservers.RemoveEntry(aURI);
|
||||
MOZ_ASSERT(key == mObservers.GetEntry(aURI), "The URIs hash mutated!");
|
||||
mObservers.RemoveEntry(key);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
|
Загрузка…
Ссылка в новой задаче