2004-11-24 Nathan Myers <ncm@cantrip.org>
authorNathan Myers <ncm@cantrip.org>
Wed, 24 Nov 2004 17:01:22 +0000 (17:01 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Wed, 24 Nov 2004 17:01:22 +0000 (17:01 +0000)
* include/bits/streambuf_iterator.h
(istreambuf_iterator<>::operator++(), operator++(int)): Don't
check unnecessarily the return value of _M_sbuf->sbumpc().

From-SVN: r91176

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/streambuf_iterator.h

index 77e328d7791ea6f84a573d797096e7b86855f80d..9ca1b15104092f6b32890ff7f6d492c544bd733d 100644 (file)
@@ -1,3 +1,9 @@
+2004-11-24  Nathan Myers  <ncm@cantrip.org>
+
+       * include/bits/streambuf_iterator.h
+       (istreambuf_iterator<>::operator++(), operator++(int)): Don't
+       check unnecessarily the return value of _M_sbuf->sbumpc().
+
 2004-11-24  Benjamin Kosnik  <bkoz@redhat.com>
 
        * include/Makefile.am (tr1_headers): Add utility, functional.
index 3e3daf62ff6d722bbb2c93a3d7d835f6d4b35a2f..df06538f97210c49b8836319265e3b5551104b72 100644 (file)
@@ -110,11 +110,11 @@ namespace std
        __glibcxx_requires_cond(!_M_at_eof(),
                                _M_message(__gnu_debug::__msg_inc_istreambuf)
                                ._M_iterator(*this));
-       const int_type __eof = traits_type::eof();
-       if (_M_sbuf && traits_type::eq_int_type(_M_sbuf->sbumpc(), __eof))
-         _M_sbuf = 0;
-       else
-         _M_c = __eof;
+       if (_M_sbuf)
+         {
+           _M_sbuf->sbumpc();
+           _M_c = traits_type::eof();
+         }
        return *this;
       }
 
@@ -126,14 +126,12 @@ namespace std
                                _M_message(__gnu_debug::__msg_inc_istreambuf)
                                ._M_iterator(*this));
 
-       const int_type __eof = traits_type::eof();
        istreambuf_iterator __old = *this;
-       if (_M_sbuf
-           && traits_type::eq_int_type((__old._M_c = _M_sbuf->sbumpc()),
-                                       __eof))
-         _M_sbuf = 0;
-       else
-         _M_c = __eof;
+       if (_M_sbuf)
+         {
+           __old._M_c = _M_sbuf->sbumpc();
+           _M_c = traits_type::eof();
+         }
        return __old;
       }