This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[v3] Remove a dead seekoff from _M_underflow
- From: Paolo Carlini <pcarlini at unitus dot it>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 22 May 2003 20:46:54 +0200
- Subject: [v3] Remove a dead seekoff from _M_underflow
Hi,
tested x86-linux, reviewed by Benjamin.
Paolo.
////////
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.
diff -urN libstdc++-v3-orig/include/bits/fstream.tcc libstdc++-v3/include/bits/fstream.tcc
--- libstdc++-v3-orig/include/bits/fstream.tcc 2003-05-16 01:43:14.000000000 +0200
+++ libstdc++-v3/include/bits/fstream.tcc 2003-05-22 13:05:45.000000000 +0200
@@ -196,8 +196,7 @@
// 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 @@
}
// 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)
{