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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@327064 91177308-0d34-0410-b5e6-96231b3b80d8
2 files changed