diff options
author | Paolo Carlini <pcarlini@unitus.it> | 2003-05-22 20:44:02 +0200 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2003-05-22 18:44:02 +0000 |
commit | 0aef8de2ae87424b237fa4905d575f4055514ed7 (patch) | |
tree | cf46c81dce23bce0914b6f43f571a56bede1d598 | |
parent | 1f85a61235ffff1f585386ac3fe113577b2a756a (diff) | |
download | gcc-0aef8de2ae87424b237fa4905d575f4055514ed7.zip gcc-0aef8de2ae87424b237fa4905d575f4055514ed7.tar.gz gcc-0aef8de2ae87424b237fa4905d575f4055514ed7.tar.bz2 |
fstream.tcc (_M_underflow): simplify...
2003-05-22 Paolo Carlini <pcarlini@unitus.it>
* include/bits/fstream.tcc (_M_underflow): simplify:
!__testout implies _M_filepos == _M_in_end, therefore
the first _M_file.seekoff call is never issued.
From-SVN: r67094
-rw-r--r-- | libstdc++-v3/ChangeLog | 6 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/fstream.tcc | 14 |
2 files changed, 9 insertions, 11 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 894faeb..29f972c 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2003-05-22 Paolo Carlini <pcarlini@unitus.it> + + * include/bits/fstream.tcc (_M_underflow): simplify: + !__testout implies _M_filepos == _M_in_end, therefore + the first _M_file.seekoff call is never issued. + 2003-05-22 Benjamin Kosnik <bkoz@redhat.com> * configure.in: Sort cross table. diff --git a/libstdc++-v3/include/bits/fstream.tcc b/libstdc++-v3/include/bits/fstream.tcc index 4fb153f..0aa93fe 100644 --- a/libstdc++-v3/include/bits/fstream.tcc +++ b/libstdc++-v3/include/bits/fstream.tcc @@ -196,8 +196,7 @@ namespace std // Check for pback madness, and if so swich back to the // normal buffers and jet outta here before expensive // fileops happen... - if (_M_pback_init) - _M_destroy_pback(); + _M_destroy_pback(); if (this->_M_in_cur < this->_M_in_end) { @@ -208,15 +207,8 @@ namespace std } // Sync internal and external buffers. - // NB: __testget -> __testput as _M_buf_unified here. - if (this->_M_in_cur > this->_M_in_beg) - { - if (__testout) - _M_overflow(); - else if (this->_M_in_cur != _M_filepos) - _M_file.seekoff(this->_M_in_cur - _M_filepos, ios_base::cur, - ios_base::in); - } + if (__testout && this->_M_out_beg < this->_M_out_lim) + _M_overflow(); if (_M_buf_size > 1) { |