]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
locale_facets.tcc (money_get::do_get(..., string_type&): Move an if block...
authorPaolo Carlini <pcarlini@suse.de>
Fri, 24 Oct 2003 10:12:05 +0000 (10:12 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Fri, 24 Oct 2003 10:12:05 +0000 (10:12 +0000)
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.

From-SVN: r72887

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

index ab64b7698c1bc09c63c457d53278d68c392977fb..16b221b8db5e0f23be1ff5b65e901f63b4063082 100644 (file)
@@ -1,3 +1,9 @@
+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
index fcc224c5e37bfabec18eff9b616dd65984b14eb5..ca9ad0510d62da0706c10113885eb81e32a0057c 100644 (file)
@@ -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;