[webkit-reviews] review granted: [Bug 95416] Replace uses of WTF::String::operator+= with StringBuilder : [Attachment 161384] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Aug 29 19:09:32 PDT 2012


Benjamin Poulain <benjamin at webkit.org> has granted Adam Barth
<abarth at webkit.org>'s request for review:
Bug 95416: Replace uses of WTF::String::operator+= with StringBuilder
https://bugs.webkit.org/show_bug.cgi?id=95416

Attachment 161384: Patch
https://bugs.webkit.org/attachment.cgi?id=161384&action=review

------- Additional Comments from Benjamin Poulain <benjamin at webkit.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=161384&action=review


Looks good. Just one comment:

> Source/WebCore/platform/network/ResourceRequestBase.cpp:377
> -	   result.iterator->second += "," + value;
> +	   result.iterator->second.append("," + value);

This change will cause 2 concatenation:
1) the string operators will create a new String for ("," + value), then
String::append() will create a new string for the result.

If you do (result.iterator->second = result.iterator->second + ',' + value),
you only get one "operation".


More information about the webkit-reviews mailing list