diff options
-rw-r--r-- | libstdc++-v3/ChangeLog | 6 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/locale_facets.tcc | 28 |
2 files changed, 20 insertions, 14 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index ab64b76..16b221b 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,11 @@ 2003-10-24 Paolo Carlini <pcarlini@suse.de> + * include/bits/locale_facets.tcc (money_get::do_get(..., + string_type&): Move an if block, thus minimizing the amount + of code processed anyway when __tmp_units.size() == 0. + +2003-10-24 Paolo Carlini <pcarlini@suse.de> + * include/bits/locale_facets.tcc (time_get<>::_M_extract_via_format): Deal with case 'C' too, equivalent to 'y'. diff --git a/libstdc++-v3/include/bits/locale_facets.tcc b/libstdc++-v3/include/bits/locale_facets.tcc index fcc224c..ca9ad05 100644 --- a/libstdc++-v3/include/bits/locale_facets.tcc +++ b/libstdc++-v3/include/bits/locale_facets.tcc @@ -1270,20 +1270,6 @@ namespace std } } - // Need to get the rest of the sign characters, if they exist. - const char_type __eof = static_cast<char_type>(char_traits<char_type>::eof()); - if (__sign.size() > 1) - { - const size_type __len = __sign.size(); - size_type __i = 1; - for (; __c != __eof && __i < __len; ++__i) - while (__beg != __end && __c != __sign[__i]) - __c = *(++__beg); - - if (__i != __len) - __testvalid = false; - } - const char_type __zero = __ctype.widen('0'); // Strip leading zeros. @@ -1322,6 +1308,20 @@ namespace std else __testvalid = false; + // Need to get the rest of the sign characters, if they exist. + const char_type __eof = static_cast<char_type>(char_traits<char_type>::eof()); + if (__sign.size() > 1) + { + const size_type __len = __sign.size(); + size_type __i = 1; + for (; __c != __eof && __i < __len; ++__i) + while (__beg != __end && __c != __sign[__i]) + __c = *(++__beg); + + if (__i != __len) + __testvalid = false; + } + // Iff no more characters are available. if (__c == __eof) __err |= ios_base::eofbit; |