diff options
author | Paolo Carlini <pcarlini@suse.de> | 2006-08-18 15:42:05 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2006-08-18 15:42:05 +0000 |
commit | 7867a3f7392e23f92f207c0cdec444b9c1c6f433 (patch) | |
tree | dbdaafea7465708d771832b62b1508908e771fbd /libstdc++-v3/include/ext | |
parent | 0a565147512df56ac9b7d4c1716312a15ee870af (diff) | |
download | gcc-7867a3f7392e23f92f207c0cdec444b9c1c6f433.zip gcc-7867a3f7392e23f92f207c0cdec444b9c1c6f433.tar.gz gcc-7867a3f7392e23f92f207c0cdec444b9c1c6f433.tar.bz2 |
re PR libstdc++/28765 (__gnu_cxx::__vstring::clear() is slow)
2006-08-18 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/28765
* include/ext/rc_string_base.h (_M_clear): New.
* include/ext/sso_string_base.h (_M_clear): Likewise.
* include/ext/vstring.h (clear): Use it.
From-SVN: r116240
Diffstat (limited to 'libstdc++-v3/include/ext')
-rw-r--r-- | libstdc++-v3/include/ext/rc_string_base.h | 4 | ||||
-rw-r--r-- | libstdc++-v3/include/ext/sso_string_base.h | 4 | ||||
-rw-r--r-- | libstdc++-v3/include/ext/vstring.h | 2 |
3 files changed, 9 insertions, 1 deletions
diff --git a/libstdc++-v3/include/ext/rc_string_base.h b/libstdc++-v3/include/ext/rc_string_base.h index eec6f2d..1a896d8 100644 --- a/libstdc++-v3/include/ext/rc_string_base.h +++ b/libstdc++-v3/include/ext/rc_string_base.h @@ -338,6 +338,10 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) void _M_erase(size_type __pos, size_type __n); + void + _M_clear() + { _M_erase(size_type(0), _M_length()); } + bool _M_compare(const __rc_string_base&) const { return false; } diff --git a/libstdc++-v3/include/ext/sso_string_base.h b/libstdc++-v3/include/ext/sso_string_base.h index 1282eb6..3098826 100644 --- a/libstdc++-v3/include/ext/sso_string_base.h +++ b/libstdc++-v3/include/ext/sso_string_base.h @@ -226,6 +226,10 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) void _M_erase(size_type __pos, size_type __n); + void + _M_clear() + { _M_set_length(0); } + bool _M_compare(const __sso_string_base&) const { return false; } diff --git a/libstdc++-v3/include/ext/vstring.h b/libstdc++-v3/include/ext/vstring.h index 5cd84b1..d858949 100644 --- a/libstdc++-v3/include/ext/vstring.h +++ b/libstdc++-v3/include/ext/vstring.h @@ -409,7 +409,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) */ void clear() - { this->_M_erase(size_type(0), this->size()); } + { this->_M_clear(); } /** * Returns true if the %string is empty. Equivalent to *this == "". |