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 402847 c2ecd54e640243aeb27ce99033d2012c53e08993
parent 402846 6546f0bc46f369750d65d7ab47492903e9ba65ee
child 402848 3add3eea31b58fd1a067c6d32e0bc8635b42624e
push id33405
push usershindli@mozilla.com
push dateThu, 08 Feb 2018 10:04:47 +0000
treeherdermozilla-central@0ac953fcddf1 [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) {