Title: [173474] trunk/Source/WebCore
Revision
173474
Author
[email protected]
Date
2014-09-10 11:10:45 -0700 (Wed, 10 Sep 2014)

Log Message

[Curl] Optimization; avoid reallocating string many times.
https://bugs.webkit.org/show_bug.cgi?id=136704

Patch by [email protected] <[email protected]> on 2014-09-10
Reviewed by Alex Christensen.

Adding individual characters to a string is inefficient, the string will be reallocated each time.

* platform/network/curl/CookieJarCurl.cpp:
(WebCore::readCurlCookieToken):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (173473 => 173474)


--- trunk/Source/WebCore/ChangeLog	2014-09-10 18:01:28 UTC (rev 173473)
+++ trunk/Source/WebCore/ChangeLog	2014-09-10 18:10:45 UTC (rev 173474)
@@ -1,5 +1,17 @@
 2014-09-10  [email protected]  <[email protected]>
 
+        [Curl] Optimization; avoid reallocating string many times.
+        https://bugs.webkit.org/show_bug.cgi?id=136704
+
+        Reviewed by Alex Christensen.
+
+        Adding individual characters to a string is inefficient, the string will be reallocated each time.
+
+        * platform/network/curl/CookieJarCurl.cpp:
+        (WebCore::readCurlCookieToken):
+
+2014-09-10  [email protected]  <[email protected]>
+
         [Curl] Compile error, CertificateInfo.h is not found.
         https://bugs.webkit.org/show_bug.cgi?id=136703
 

Modified: trunk/Source/WebCore/platform/network/curl/CookieJarCurl.cpp (173473 => 173474)


--- trunk/Source/WebCore/platform/network/curl/CookieJarCurl.cpp	2014-09-10 18:01:28 UTC (rev 173473)
+++ trunk/Source/WebCore/platform/network/curl/CookieJarCurl.cpp	2014-09-10 18:10:45 UTC (rev 173474)
@@ -35,10 +35,10 @@
 {
     // Read the next token from a cookie with the Netscape cookie format.
     // Curl separates each token in line with tab character.
-    while (cookie && cookie[0] && cookie[0] != '\t') {
-        token.append(cookie[0]);
+    const char* cookieStart = cookie;
+    while (cookie && cookie[0] && cookie[0] != '\t')
         cookie++;
-    }
+    token = String(cookieStart, cookie - cookieStart);
     if (cookie[0] == '\t')
         cookie++;
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to