Optimize truncating a basic_string
authorJonathan Wakely <jwakely@redhat.com>
Fri, 23 Sep 2016 17:25:23 +0000 (18:25 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Fri, 23 Sep 2016 17:25:23 +0000 (18:25 +0100)
commita922c5ff6f3872fc9ce1e484a0e92f288ff6c68d
tree62231e54ad2ab9735e402dda27e441a3c84f50bb
parentb862552dff04fbd4c7debf07a7c82d361869a552
Optimize truncating a basic_string

* include/bits/basic_string.h [_GLIBCXX_USE_CXX11_ABI]
(basic_string::erase(size_type, size_type)): Add fast path for
truncating the string, by calling _M_set_length directly.
(basic_string::erase(__const_iterator, __const_iterator)): Likewise.
* include/bits/basic_string.tcc [_GLIBCXX_USE_CXX11_ABI]
(basic_string::resize(size_type, _CharT)): Likewise.

From-SVN: r240446
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/basic_string.h
libstdc++-v3/include/bits/basic_string.tcc