aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Kosnik <bkoz@redhat.com>2003-06-03 18:06:09 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2003-06-03 18:06:09 +0000
commitf24ce7c1c37f7f7990d78e3c0f9467f76d4cfee6 (patch)
treeded478775672473d3896da6e6cd3718f29855632
parent6d07784ac292116b737346dffde1e2ee5f230d6b (diff)
downloadgcc-f24ce7c1c37f7f7990d78e3c0f9467f76d4cfee6.zip
gcc-f24ce7c1c37f7f7990d78e3c0f9467f76d4cfee6.tar.gz
gcc-f24ce7c1c37f7f7990d78e3c0f9467f76d4cfee6.tar.bz2
fstream.tcc (pbackfail): Make a rarely taken 'if' branch less obscure.
2003-06-03 Benjamin Kosnik <bkoz@redhat.com> * include/bits/fstream.tcc (pbackfail): Make a rarely taken 'if' branch less obscure. From-SVN: r67394
-rw-r--r--libstdc++-v3/ChangeLog5
-rw-r--r--libstdc++-v3/include/bits/fstream.tcc10
2 files changed, 12 insertions, 3 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 0848e64..b64a154 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,8 @@
+2003-06-03 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/bits/fstream.tcc (pbackfail): Make a rarely taken
+ 'if' branch less obscure.
+
2003-06-02 Andrew Pinski <pinskia@physics.uc.edu>
PR libstdc++/9815
diff --git a/libstdc++-v3/include/bits/fstream.tcc b/libstdc++-v3/include/bits/fstream.tcc
index e84eee0..e4119bf 100644
--- a/libstdc++-v3/include/bits/fstream.tcc
+++ b/libstdc++-v3/include/bits/fstream.tcc
@@ -284,9 +284,13 @@ namespace std
// But the seek may fail (f.i., at the beginning of
// a file, see libstdc++/9439) and in that case
// we return traits_type::eof().
- else if (this->seekoff(-1, ios_base::cur) < 0
- || traits_type::eq_int_type(__tmp = this->underflow(),
- traits_type::eof()))
+ else if (this->seekoff(-1, ios_base::cur) >= 0)
+ {
+ __tmp = this->underflow();
+ if (traits_type::eq_int_type(__tmp, __ret))
+ return __ret;
+ }
+ else
return __ret;
// Try to put back __i into input sequence in one of three ways.