sstream.tcc (pbackfail): Minor clean up and reformatting, consistent with basic_fileb...
authorPaolo Carlini <pcarlini@unitus.it>
Mon, 2 Jun 2003 18:24:30 +0000 (20:24 +0200)
committerPaolo Carlini <paolo@gcc.gnu.org>
Mon, 2 Jun 2003 18:24:30 +0000 (18:24 +0000)
2003-06-02  Paolo Carlini  <pcarlini@unitus.it>

* include/bits/sstream.tcc (pbackfail): Minor clean up and
reformatting, consistent with basic_filebuf::pbackfail.

From-SVN: r67342

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

index 035215fba011811e6469f1c1159a174e9a260459..7e204bc4c1b10a4aa922e6d2b8ce051c2b8f98a5 100644 (file)
@@ -1,3 +1,8 @@
+2003-06-02  Paolo Carlini  <pcarlini@unitus.it>
+
+       * include/bits/sstream.tcc (pbackfail): Minor clean up and
+       reformatting, consistent with basic_filebuf::pbackfail.
+
 2003-06-02  Richard Kreckel  <Richard.Kreckel@GiNaC.DE>
 
        PR libstdc++/11062
index b506d184334f7e047521fdb9bc16e9562a1a0e74..49a5aa0106e688da3d63b509fd66e91bd41ab3f3 100644 (file)
@@ -47,18 +47,16 @@ namespace std
     pbackfail(int_type __c)
     {
       int_type __ret = traits_type::eof();
-      const bool __testeof = traits_type::eq_int_type(__c,
-                                                     traits_type::eof());
-      const bool __testpos = this->_M_in_beg < this->_M_in_cur; 
+      const bool __testeof = traits_type::eq_int_type(__c, __ret);
       
-      // Try to put back __c into input sequence in one of three ways.
-      // Order these tests done in is unspecified by the standard.
-      if (__testpos)
+      if (this->_M_in_beg < this->_M_in_cur)
        {
          const bool __testeq = traits_type::eq(traits_type::to_char_type(__c),
                                                this->_M_in_cur[-1]);
-         
          --this->_M_in_cur;
+
+         // Try to put back __c into input sequence in one of three ways.
+         // Order these tests done in is unspecified by the standard.
          if (!__testeof && __testeq)
            __ret = __c;
          else if (__testeof)