aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorPaolo Carlini <pcarlini@suse.de>2006-08-18 15:42:05 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2006-08-18 15:42:05 +0000
commit7867a3f7392e23f92f207c0cdec444b9c1c6f433 (patch)
treedbdaafea7465708d771832b62b1508908e771fbd /libstdc++-v3
parent0a565147512df56ac9b7d4c1716312a15ee870af (diff)
downloadgcc-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')
-rw-r--r--libstdc++-v3/ChangeLog7
-rw-r--r--libstdc++-v3/include/ext/rc_string_base.h4
-rw-r--r--libstdc++-v3/include/ext/sso_string_base.h4
-rw-r--r--libstdc++-v3/include/ext/vstring.h2
4 files changed, 16 insertions, 1 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index a9556d7..9d692ab 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,10 @@
+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.
+
2006-08-15 Paolo Carlini <pcarlini@suse.de>
* include/tr1/random (poisson_distribution<>::_M_initialize): Add.
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 == "".