aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Carlini <pcarlini@unitus.it>2003-05-03 01:02:03 +0200
committerPaolo Carlini <paolo@gcc.gnu.org>2003-05-02 23:02:03 +0000
commit4571fbb1eca3c9d7eaff3d3d60b21312e238a2b0 (patch)
tree7b2fe6bb4e24fa1eb2ca8729b828b25ac0a93a00
parent07a0a04486083d9c6dbf1e87c23ebaf10583036d (diff)
downloadgcc-4571fbb1eca3c9d7eaff3d3d60b21312e238a2b0.zip
gcc-4571fbb1eca3c9d7eaff3d3d60b21312e238a2b0.tar.gz
gcc-4571fbb1eca3c9d7eaff3d3d60b21312e238a2b0.tar.bz2
std_sstream.h (str()): Tidy.
2003-05-02 Paolo Carlini <pcarlini@unitus.it> * include/std/std_sstream.h (str()): Tidy. From-SVN: r66402
-rw-r--r--libstdc++-v3/ChangeLog4
-rw-r--r--libstdc++-v3/include/std/std_sstream.h12
2 files changed, 8 insertions, 8 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 55e7538..cc86e86 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,7 @@
+2003-05-02 Paolo Carlini <pcarlini@unitus.it>
+
+ * include/std/std_sstream.h (str()): Tidy.
+
2003-05-02 Nathan Myers <ncm@cantrip.org>
Paolo Carlini <pcarlini@unitus.it>
diff --git a/libstdc++-v3/include/std/std_sstream.h b/libstdc++-v3/include/std/std_sstream.h
index 1d9a549..bc11323 100644
--- a/libstdc++-v3/include/std/std_sstream.h
+++ b/libstdc++-v3/include/std/std_sstream.h
@@ -133,15 +133,11 @@ namespace std
__string_type
str() const
{
+ const bool __testout = this->_M_mode & ios_base::out;
__string_type __ret = _M_string;
- if (this->_M_mode & ios_base::out)
- {
- const __size_type __nlen = this->_M_out_lim
- - this->_M_out_beg;
- if (__nlen)
- __ret = __string_type(this->_M_out_beg,
- this->_M_out_beg + __nlen);
- }
+ if (__testout && this->_M_out_beg < this->_M_out_lim)
+ __ret = __string_type(this->_M_out_beg,
+ this->_M_out_lim);
return __ret;
}