From 9190866b939d910c36de41b6319d1e5ef5668809 Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Tue, 7 Jun 2016 04:10:25 -0400 Subject: [PATCH] Bug 1277890 - part 1 - avoid unnecessary refcounting when building the filters list; r=baku We can pass the atom reference we have into the filter list, there's no need for the filter list to retain a separate reference of the atom. --- dom/base/nsDOMMutationObserver.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dom/base/nsDOMMutationObserver.cpp b/dom/base/nsDOMMutationObserver.cpp index 0a5a14a9d92e..45d9495cb00b 100644 --- a/dom/base/nsDOMMutationObserver.cpp +++ b/dom/base/nsDOMMutationObserver.cpp @@ -685,8 +685,7 @@ nsDOMMutationObserver::Observe(nsINode& aTarget, filters.SetCapacity(len); for (uint32_t i = 0; i < len; ++i) { - nsCOMPtr a = NS_Atomize(filtersAsString[i]); - filters.AppendObject(a); + filters.AppendElement(NS_Atomize(filtersAsString[i])); } }