Bug 1383128 - Avoid some useless AddRef()s when parsing class attributes; r=smaug
authorEhsan Akhgari <ehsan@mozilla.com>
Fri, 21 Jul 2017 12:46:44 -0400
changeset 419060 098c638791f5e19c1b174c267ae6df2a7075f814
parent 419059 fafcbde047540092ab629013acedb177026660e5
child 419061 af4e6769980056fa8a5cebdb9f225ab98d34c2d5
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1383128
milestone56.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 1383128 - Avoid some useless AddRef()s when parsing class attributes; r=smaug
dom/base/nsAttrValue.cpp
--- a/dom/base/nsAttrValue.cpp
+++ b/dom/base/nsAttrValue.cpp
@@ -1298,32 +1298,32 @@ nsAttrValue::ParseAtomArray(const nsAStr
   }
 
   if (!EnsureEmptyAtomArray()) {
     return;
   }
 
   AtomArray* array = GetAtomArrayValue();
 
-  if (!array->AppendElement(classAtom)) {
+  if (!array->AppendElement(Move(classAtom))) {
     Reset();
     return;
   }
 
   // parse the rest of the classnames
   while (iter != end) {
     start = iter;
 
     do {
       ++iter;
     } while (iter != end && !nsContentUtils::IsHTMLWhitespace(*iter));
 
     classAtom = NS_AtomizeMainThread(Substring(start, iter));
 
-    if (!array->AppendElement(classAtom)) {
+    if (!array->AppendElement(Move(classAtom))) {
       Reset();
       return;
     }
 
     // skip whitespace
     while (iter != end && nsContentUtils::IsHTMLWhitespace(*iter)) {
       ++iter;
     }