summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2003-04-28 21:28:25 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2003-04-28 21:28:25 +0000
commit103f5339e72d602b2e619c82781625f0cf1375ec (patch)
treeea2eca0d9eba7bbb9657cbf60a619dff20e9e5a7
parent4e84a9475cf7e6be1993534b52cd93556c6cb33b (diff)
downloadppe42-gcc-103f5339e72d602b2e619c82781625f0cf1375ec.tar.gz
ppe42-gcc-103f5339e72d602b2e619c82781625f0cf1375ec.zip
2003-04-28 Paolo Carlini <pcarlini@unitus.it>
* include/bits/sstream.tcc (pbackfail): Shorten a bit (6 lines) the innermost 'if' by factoring out some code. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@66187 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--libstdc++-v3/ChangeLog5
-rw-r--r--libstdc++-v3/include/bits/sstream.tcc23
2 files changed, 14 insertions, 14 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 75c88010ff0..cc8ed88c95c 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,8 @@
+2003-04-28 Paolo Carlini <pcarlini@unitus.it>
+
+ * include/bits/sstream.tcc (pbackfail): Shorten a bit (6 lines)
+ the innermost 'if' by factoring out some code.
+
2003-04-28 Phil Edwards <pme@gcc.gnu.org>
* configure.in: Test for libintl.h.
diff --git a/libstdc++-v3/include/bits/sstream.tcc b/libstdc++-v3/include/bits/sstream.tcc
index 801a34a4dba..1d8cc005d98 100644
--- a/libstdc++-v3/include/bits/sstream.tcc
+++ b/libstdc++-v3/include/bits/sstream.tcc
@@ -55,24 +55,19 @@ namespace std
// Order these tests done in is unspecified by the standard.
if (__testpos)
{
- if (traits_type::eq(traits_type::to_char_type(__c),
- this->_M_in_cur[-1])
- && !__testeof)
- {
- --this->_M_in_cur;
- __ret = __c;
- }
- else if (!__testeof)
+ const bool __testeq = traits_type::eq(traits_type::to_char_type(__c),
+ this->_M_in_cur[-1]);
+
+ --this->_M_in_cur;
+ if (!__testeof && __testeq)
+ __ret = __c;
+ else if (__testeof)
+ __ret = traits_type::not_eof(__c);
+ else
{
- --this->_M_in_cur;
*this->_M_in_cur = traits_type::to_char_type(__c);
__ret = __c;
}
- else if (__testeof)
- {
- --this->_M_in_cur;
- __ret = traits_type::not_eof(__c);
- }
}
return __ret;
}
OpenPOWER on IntegriCloud