[PATCH] D41976: Low-hanging fruit optimization in string::__move_assign().

Timothy VanSlyke via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 16 08:15:23 PST 2018

tvanslyke added a comment.

Just to elaborate, in `reserve(0)` after the deallocation there's a check `if (__now_long)` which takes the else branch and only ends up calling `__set_short_size(__sz); // __sz = 0 here`.  So even without this diff the only thing `reserve(0)` does after deallocating is set the short size to zero, but it already is zero (because of the call to `clear()`).


More information about the cfe-commits mailing list