]> granicus.if.org Git - icu/commitdiff
ICU-10756 fix operator= ( restores performance for the createInstance() / applyPatter...
authorSteven R. Loomis <srl@icu-project.org>
Wed, 5 Mar 2014 23:11:07 +0000 (23:11 +0000)
committerSteven R. Loomis <srl@icu-project.org>
Wed, 5 Mar 2014 23:11:07 +0000 (23:11 +0000)
X-SVN-Rev: 35348

icu4c/source/i18n/dcfmtimp.h
icu4c/source/i18n/decimfmt.cpp

index 4256fd07618de278029c5b606467652c060efca0..0f27a8d947866af474aa72b8db1c86b1837d3fec 100644 (file)
@@ -1,6 +1,6 @@
 /*
 ********************************************************************************
-*   Copyright (C) 2012, International Business Machines
+*   Copyright (C) 2012-2014, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 ********************************************************************************/
 
@@ -26,7 +26,12 @@ enum EDecimalFormatFastpathStatus {
 struct DecimalFormatInternal {
   uint8_t    fFastFormatStatus;
   uint8_t    fFastParseStatus;
-  
+
+  DecimalFormatInternal &operator=(const DecimalFormatInternal& rhs) {
+    fFastParseStatus = rhs.fFastParseStatus;
+    fFastFormatStatus = rhs.fFastFormatStatus;
+    return *this;
+  }
 #ifdef FMT_DEBUG
   void dump() const {
     printf("DecimalFormatInternal: fFastFormatStatus=%c, fFastParseStatus=%c\n",
@@ -34,7 +39,7 @@ struct DecimalFormatInternal {
            "NY?"[(int)fFastParseStatus&3]
            );
   }
-#endif  
+#endif
 };
 
 
index eb9e1481c53a8c82c7bc8c7f902687fcc77ff1ec..b7a56ff0fbe2813b0ffd4557513c2d824bd0d891 100644 (file)
@@ -835,10 +835,12 @@ DecimalFormat::operator=(const DecimalFormat& rhs)
             fPluralAffixesForCurrency = initHashForAffixPattern(status);
             copyHashForAffix(rhs.fPluralAffixesForCurrency, fPluralAffixesForCurrency, status);
         }
-    }
 #if UCONFIG_FORMAT_FASTPATHS_49
-    handleChanged();
+        DecimalFormatInternal &data    = internalData(fReserved);
+        const DecimalFormatInternal &rhsData = internalData(rhs.fReserved);
+        data = rhsData;
 #endif
+    }
     return *this;
 }