Commit 7867a3f7 by Paolo Carlini Committed by Paolo Carlini

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
parent 0a565147
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.
......
......@@ -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; }
......
......@@ -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; }
......
......@@ -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 == "".
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment