mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-14 17:24:01 +00:00
ICU-10756 fix operator= ( restores performance for the createInstance() / applyPattern("#") case )
X-SVN-Rev: 35348
This commit is contained in:
parent
8700d5b055
commit
3226c52b08
2 changed files with 12 additions and 5 deletions
|
@ -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
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue