From: Paolo Carlini Date: Fri, 2 May 2003 23:02:03 +0000 (+0200) Subject: std_sstream.h (str()): Tidy. X-Git-Tag: releases/gcc-3.4.0~6859 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4571fbb1eca3c9d7eaff3d3d60b21312e238a2b0;p=thirdparty%2Fgcc.git std_sstream.h (str()): Tidy. 2003-05-02 Paolo Carlini * include/std/std_sstream.h (str()): Tidy. From-SVN: r66402 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 55e7538b39b2..cc86e86db346 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,7 @@ +2003-05-02 Paolo Carlini + + * include/std/std_sstream.h (str()): Tidy. + 2003-05-02 Nathan Myers Paolo Carlini diff --git a/libstdc++-v3/include/std/std_sstream.h b/libstdc++-v3/include/std/std_sstream.h index 1d9a54970c5f..bc11323c7213 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; }