diff options
author | Nathan Myers <ncm@cantrip.org> | 2004-11-24 17:01:22 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2004-11-24 17:01:22 +0000 |
commit | eacf72d384a7b6e0484c6bdfb2ab3f5f1d91eef1 (patch) | |
tree | 689b9a071e8e4692a18d3864833dd4c50583e012 | |
parent | bada2eb851f70e49bb06d04586b767c5ba3a4d16 (diff) | |
download | gcc-eacf72d384a7b6e0484c6bdfb2ab3f5f1d91eef1.zip gcc-eacf72d384a7b6e0484c6bdfb2ab3f5f1d91eef1.tar.gz gcc-eacf72d384a7b6e0484c6bdfb2ab3f5f1d91eef1.tar.bz2 |
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().
From-SVN: r91176
-rw-r--r-- | libstdc++-v3/ChangeLog | 6 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/streambuf_iterator.h | 22 |
2 files changed, 16 insertions, 12 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 77e328d..9ca1b15 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -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. diff --git a/libstdc++-v3/include/bits/streambuf_iterator.h b/libstdc++-v3/include/bits/streambuf_iterator.h index 3e3daf6..df06538 100644 --- a/libstdc++-v3/include/bits/streambuf_iterator.h +++ b/libstdc++-v3/include/bits/streambuf_iterator.h @@ -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; } |