Building strings through concatenation has a memory and performance cost – a memory cost since we must over-allocate the buffer to leave space to append into, and performance in that the string may still require reallocation (and thus copying during construction). Instead move the full construction to within a single function call (makeString), so that the arguments' lengths can be calculated and an appropriate sized buffer allocated before copying any characters.
Created attachment 44713 [details] The patch
Attachment 44713 [details] did not pass style-queue: Failed to run "WebKitTools/Scripts/check-webkit-style" exit_code: 1 JavaScriptCore/runtime/UString.h:547: This { should be at the end of the previous line [whitespace/braces] [4] JavaScriptCore/runtime/UString.h:570: This { should be at the end of the previous line [whitespace/braces] [4] JavaScriptCore/runtime/UString.h:593: This { should be at the end of the previous line [whitespace/braces] [4] Total errors found: 3
Comment on attachment 44713 [details] The patch rme=
Transmitting file data ................. Committed revision 52028.