ICU-10756 fix operator= ( restores performance for the createInstance() / applyPattern("#") case )

X-SVN-Rev: 35348
This commit is contained in:
Steven R. Loomis 2014-03-05 23:11:07 +00:00
parent 8700d5b055
commit 3226c52b08
2 changed files with 12 additions and 5 deletions

View 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
};

View 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;
}