summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2004-11-04 11:29:30 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2004-11-04 11:29:30 +0000
commited48bcbb3d134bc4025bb091fbf6f28522aca32e (patch)
treef89065e86a657cc1677b846ea604653143adc1a4
parent09f175faf45de531364cdb6f959ee6c146605caa (diff)
downloadgcc-ed48bcbb3d134bc4025bb091fbf6f28522aca32e.tar.gz
2004-11-04 Paolo Carlini <pcarlini@suse.de>
* include/bits/locale_facets.tcc (num_get<>::do_get(bool&)): Evaluate __beg == __end the exact strict minimum number of times. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@90058 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--libstdc++-v3/ChangeLog5
-rw-r--r--libstdc++-v3/include/bits/locale_facets.tcc8
2 files changed, 11 insertions, 2 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 6848060c05a..719bd39b635 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,8 @@
+2004-11-04 Paolo Carlini <pcarlini@suse.de>
+
+ * include/bits/locale_facets.tcc (num_get<>::do_get(bool&)):
+ Evaluate __beg == __end the exact strict minimum number of times.
+
2004-11-03 Jonathan Wakely <redi@gcc.gnu.org>
* include/bits/stl_numeric.h (partial_sum, adjacent_difference):
diff --git a/libstdc++-v3/include/bits/locale_facets.tcc b/libstdc++-v3/include/bits/locale_facets.tcc
index c32a65da765..41778bca710 100644
--- a/libstdc++-v3/include/bits/locale_facets.tcc
+++ b/libstdc++-v3/include/bits/locale_facets.tcc
@@ -687,7 +687,8 @@ namespace std
bool __testf = true;
bool __testt = true;
size_t __n;
- for (__n = 0; __beg != __end; ++__n, ++__beg)
+ bool __testeof = __beg == __end;
+ for (__n = 0; !__testeof; ++__n)
{
const char_type __c = *__beg;
@@ -705,6 +706,9 @@ namespace std
if (!__testf && !__testt)
break;
+
+ if (++__beg == __end)
+ __testeof = true;
}
if (__testf && __n == __lc->_M_falsename_size)
__v = 0;
@@ -713,7 +717,7 @@ namespace std
else
__err |= ios_base::failbit;
- if (__beg == __end)
+ if (__testeof)
__err |= ios_base::eofbit;
}
return __beg;