Low-hanging fruit optimization in string::__move_assign().
shrink_to_fit() ends up doing a lot work to get information that we already know since we just called clear(). This change seems concise enough to be worth the couple extra lines and my benchmarks show that it is indeed a pretty decent win. It looks like the same thing is going on twice in __copy_assign_alloc(), but I didn't want to go overboard since this is my first contribution to llvm/libc++. Patch by Timothy VanSlyke! Differential Revision: https://reviews.llvm.org/D41976 llvm-svn: 327064
Loading
Please register or sign in to comment