Skip to content
Snippets Groups Projects
Commit 7153f980 authored by Per Hedbor's avatar Per Hedbor
Browse files

The operation "empty_string += string" is now significantly faster.

This is rather common in code that works with buffers. Previously it
was, somewhat surpisingly, significantly faster to write code like:

  if( strlen( x ) )
     x += str;
  else
     x = str;

than it was to simply add the str to x regardless of whether or not x
already had contents.

Now the check is done in `+() instead. However, it still does not
handle things like "" + str + "", which might perhaps be useful, but
is significantly less common in real code.

str + "" was already handled.
parent 3402a638
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment