Title: [125132] trunk/Source/WebCore
Revision
125132
Author
[email protected]
Date
2012-08-08 18:10:01 -0700 (Wed, 08 Aug 2012)

Log Message

writeHelperGetString in V8HTMLDocument uses += to concatenate strings
https://bugs.webkit.org/show_bug.cgi?id=93035

Patch by Jae Hyun Park <[email protected]> on 2012-08-08
Reviewed by Adam Barth.

Use a StringBuilder instead of String concatenation because StringBuilder is generally faster.

No new functionality, so no new tests.

* bindings/v8/custom/V8HTMLDocumentCustom.cpp:
(WebCore::writeHelperGetString):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (125131 => 125132)


--- trunk/Source/WebCore/ChangeLog	2012-08-09 01:07:24 UTC (rev 125131)
+++ trunk/Source/WebCore/ChangeLog	2012-08-09 01:10:01 UTC (rev 125132)
@@ -1,3 +1,17 @@
+2012-08-08  Jae Hyun Park  <[email protected]>
+
+        writeHelperGetString in V8HTMLDocument uses += to concatenate strings
+        https://bugs.webkit.org/show_bug.cgi?id=93035
+
+        Reviewed by Adam Barth.
+
+        Use a StringBuilder instead of String concatenation because StringBuilder is generally faster.
+
+        No new functionality, so no new tests.
+
+        * bindings/v8/custom/V8HTMLDocumentCustom.cpp:
+        (WebCore::writeHelperGetString):
+
 2012-08-08  Adrienne Walker  <[email protected]>
 
         [chromium] Move scrollbar pointer into WebScrollbarThemePainter

Modified: trunk/Source/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp (125131 => 125132)


--- trunk/Source/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp	2012-08-09 01:07:24 UTC (rev 125131)
+++ trunk/Source/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp	2012-08-09 01:10:01 UTC (rev 125132)
@@ -46,6 +46,7 @@
 #include "V8Node.h"
 #include "V8Proxy.h"
 #include "V8RecursionScope.h"
+#include <wtf/text/StringBuilder.h>
 #include <wtf/OwnArrayPtr.h>
 #include <wtf/RefPtr.h>
 #include <wtf/StdLibExtras.h>
@@ -109,10 +110,10 @@
 //   document.write() --> document.write("")
 static String writeHelperGetString(const v8::Arguments& args)
 {
-    String str = "";
+    StringBuilder builder;
     for (int i = 0; i < args.Length(); ++i)
-        str += toWebCoreString(args[i]);
-    return str;
+        builder.append(toWebCoreString(args[i]));
+    return builder.toString();
 }
 
 v8::Handle<v8::Value> V8HTMLDocument::writeCallback(const v8::Arguments& args)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to