Title: [197438] trunk/Source/_javascript_Core
Revision
197438
Author
[email protected]
Date
2016-03-01 20:30:45 -0800 (Tue, 01 Mar 2016)

Log Message

Simplify some StringBuilder appends
https://bugs.webkit.org/show_bug.cgi?id=154902

Patch by Joseph Pecoraro <[email protected]> on 2016-03-01
Reviewed by Mark Lam.

* runtime/ExceptionHelpers.cpp:
(JSC::notAFunctionSourceAppender):
* runtime/SamplingProfiler.cpp:
(JSC::SamplingProfiler::stackTracesAsJSON):
Use StringBuilder::append(char) instead of append(char*) where possible.

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (197437 => 197438)


--- trunk/Source/_javascript_Core/ChangeLog	2016-03-02 03:22:29 UTC (rev 197437)
+++ trunk/Source/_javascript_Core/ChangeLog	2016-03-02 04:30:45 UTC (rev 197438)
@@ -1,3 +1,16 @@
+2016-03-01  Joseph Pecoraro  <[email protected]>
+
+        Simplify some StringBuilder appends
+        https://bugs.webkit.org/show_bug.cgi?id=154902
+
+        Reviewed by Mark Lam.
+
+        * runtime/ExceptionHelpers.cpp:
+        (JSC::notAFunctionSourceAppender):
+        * runtime/SamplingProfiler.cpp:
+        (JSC::SamplingProfiler::stackTracesAsJSON):
+        Use StringBuilder::append(char) instead of append(char*) where possible.
+
 2016-03-01  Keith Miller  <[email protected]>
 
         Promise.prototype.then should use Symbol.species to construct the return Promise

Modified: trunk/Source/_javascript_Core/runtime/ExceptionHelpers.cpp (197437 => 197438)


--- trunk/Source/_javascript_Core/runtime/ExceptionHelpers.cpp	2016-03-02 03:22:29 UTC (rev 197437)
+++ trunk/Source/_javascript_Core/runtime/ExceptionHelpers.cpp	2016-03-02 04:30:45 UTC (rev 197438)
@@ -186,7 +186,7 @@
     if (type == TypeObject)
         builder.appendLiteral("an instance of ");
     builder.append(displayValue);
-    builder.appendLiteral(")");
+    builder.append(')');
 
     return builder.toString();
 }

Modified: trunk/Source/_javascript_Core/runtime/SamplingProfiler.cpp (197437 => 197438)


--- trunk/Source/_javascript_Core/runtime/SamplingProfiler.cpp	2016-03-02 03:22:29 UTC (rev 197437)
+++ trunk/Source/_javascript_Core/runtime/SamplingProfiler.cpp	2016-03-02 04:30:45 UTC (rev 197438)
@@ -731,29 +731,29 @@
     }
 
     StringBuilder json;
-    json.appendLiteral("[");
+    json.append('[');
 
     bool loopedOnce = false;
     auto comma = [&] {
         if (loopedOnce)
-            json.appendLiteral(",");
+            json.append(',');
     };
     for (StackTrace& stackTrace : m_stackTraces) {
         comma();
-        json.appendLiteral("[");
+        json.append('[');
         loopedOnce = false;
         for (StackFrame& stackFrame : stackTrace.frames) {
             comma();
-            json.appendLiteral("\"");
+            json.append('"');
             json.append(stackFrame.displayNameForJSONTests(m_vm));
-            json.appendLiteral("\"");
+            json.append('"');
             loopedOnce = true;
         }
-        json.appendLiteral("]");
+        json.append(']');
         loopedOnce = true;
     }
 
-    json.appendLiteral("]");
+    json.append(']');
 
     clearData(locker);
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to