зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1376491 - Use Lookup instead of Get+Remove to avoid unnecessary hashtable lookups. r=froydnj
MozReview-Commit-ID: 99pNpzMRvJF
This commit is contained in:
Родитель
008ea680be
Коммит
b9f0924f9a
|
@ -183,13 +183,12 @@ NS_IMETHODIMP
|
|||
nsWindowDataSource::OnCloseWindow(nsIXULWindow *window)
|
||||
{
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIRDFResource> resource;
|
||||
mWindowResources.Get(window, getter_AddRefs(resource));
|
||||
if (!resource) {
|
||||
auto entry = mWindowResources.Lookup(window);
|
||||
if (!entry) {
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
mWindowResources.Remove(window);
|
||||
nsCOMPtr<nsIRDFResource> resource(entry.Data().forget());
|
||||
entry.Remove();
|
||||
|
||||
// make sure we're not shutting down
|
||||
if (!mContainer) return NS_OK;
|
||||
|
|
Загрузка…
Ссылка в новой задаче