From 509228203e929a5aa3205aaa838700235187dc1d Mon Sep 17 00:00:00 2001
From: Paolo Carlini <pcarlini@suse.de>
Date: Sun, 14 Nov 2004 22:54:24 +0000
Subject: [PATCH] streambuf_iterator.h (istreambuf_iterator::_M_get): Slightly
 tweak for clarity (also leads to measurably better code).

2004-11-14  Paolo Carlini  <pcarlini@suse.de>

	* include/bits/streambuf_iterator.h (istreambuf_iterator::_M_get):
	Slightly tweak for clarity (also leads to measurably better code).

From-SVN: r90636
---
 libstdc++-v3/ChangeLog                         | 5 +++++
 libstdc++-v3/include/bits/streambuf_iterator.h | 7 ++++---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index ff93b2df6a9b..fd553a136d07 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,8 @@
+2004-11-14  Paolo Carlini  <pcarlini@suse.de>
+
+	* include/bits/streambuf_iterator.h (istreambuf_iterator::_M_get):
+	Slightly tweak for clarity (also leads to measurably better code).
+
 2004-11-12  Andrew Pinski  <pinskia@physics.uc.edu>
 
 	PR other/14264
diff --git a/libstdc++-v3/include/bits/streambuf_iterator.h b/libstdc++-v3/include/bits/streambuf_iterator.h
index f378862ed14c..3e3daf62ff6d 100644
--- a/libstdc++-v3/include/bits/streambuf_iterator.h
+++ b/libstdc++-v3/include/bits/streambuf_iterator.h
@@ -157,10 +157,11 @@ namespace std
 	int_type __ret = __eof;
 	if (_M_sbuf)
 	  {
-	    if (!traits_type::eq_int_type(_M_c, __eof)
-		|| !traits_type::eq_int_type((_M_c = _M_sbuf->sgetc()),
-					     __eof))
+	    if (!traits_type::eq_int_type(_M_c, __eof))
 	      __ret = _M_c;
+	    else if (!traits_type::eq_int_type((__ret = _M_sbuf->sgetc()),
+					       __eof))
+	      _M_c = __ret;
 	    else
 	      _M_sbuf = 0;
 	  }