fstream.tcc (pbackfail): Make a rarely taken 'if' branch less obscure.
authorBenjamin Kosnik <bkoz@redhat.com>
Tue, 3 Jun 2003 18:06:09 +0000 (18:06 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Tue, 3 Jun 2003 18:06:09 +0000 (18:06 +0000)
2003-06-03  Benjamin Kosnik  <bkoz@redhat.com>

* include/bits/fstream.tcc (pbackfail): Make a rarely taken
'if' branch less obscure.

From-SVN: r67394

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/fstream.tcc

index 0848e64d020d349b5cca6ed80552d80546f70430..b64a1547aee66aabb2b944a7f69a6db04bd5b62d 100644 (file)
@@ -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
index e84eee04efd80f95ccdf8a00e31ab7b00df33103..e4119bfcff26be3f9ec43f6068851df4e618ec02 100644 (file)
@@ -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.