Bug 1435911 - use a static const char array in nsPlainTextSerializer::DoOpenContainer; r=farre
authorNathan Froyd <froydnj@mozilla.com>
Wed, 07 Feb 2018 12:49:43 -0500
changeset 457849 c2ecd54e640243aeb27ce99033d2012c53e08993
parent 457848 6546f0bc46f369750d65d7ab47492903e9ba65ee
child 457850 3add3eea31b58fd1a067c6d32e0bc8635b42624e
push id1683
push usersfraser@mozilla.com
push dateThu, 26 Apr 2018 16:43:40 +0000
treeherdermozilla-release@5af6cb21869d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfarre
bugs1435911
milestone60.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 1435911 - use a static const char array in nsPlainTextSerializer::DoOpenContainer; r=farre We never modify this array, so it might as well live in read-only memory.
dom/base/nsPlainTextSerializer.cpp
--- a/dom/base/nsPlainTextSerializer.cpp
+++ b/dom/base/nsPlainTextSerializer.cpp
@@ -693,17 +693,17 @@ nsPlainTextSerializer::DoOpenContainer(n
       else {
         mInIndentString.Append(char16_t('#'));
       }
 
       mInIndentString.Append(char16_t('.'));
 
     }
     else {
-      static char bulletCharArray[] = "*o+#";
+      static const char bulletCharArray[] = "*o+#";
       uint32_t index = mULCount > 0 ? (mULCount - 1) : 3;
       char bulletChar = bulletCharArray[index % 4];
       mInIndentString.Append(char16_t(bulletChar));
     }
 
     mInIndentString.Append(char16_t(' '));
   }
   else if (aTag == nsGkAtoms::dl) {