ICU-12572 Moving error code check one level deeper such that the constructor does not leave the NumberFormatterImpl in an undefined state for destruction later.

X-SVN-Rev: 41316
This commit is contained in:
Shane Carr 2018-05-03 09:02:39 +00:00
parent a41f51ad5f
commit ef26576a96

View File

@ -125,7 +125,6 @@ int32_t NumberFormatterImpl::getPrefixSuffixUnsafe(int8_t signum, StandardPlural
}
NumberFormatterImpl::NumberFormatterImpl(const MacroProps& macros, bool safe, UErrorCode& status) {
if (U_FAILURE(status)) { return; }
fMicroPropsGenerator = macrosToMicroGenerator(macros, safe, status);
}
@ -133,6 +132,7 @@ NumberFormatterImpl::NumberFormatterImpl(const MacroProps& macros, bool safe, UE
const MicroPropsGenerator*
NumberFormatterImpl::macrosToMicroGenerator(const MacroProps& macros, bool safe, UErrorCode& status) {
if (U_FAILURE(status)) { return nullptr; }
const MicroPropsGenerator* chain = &fMicros;
// Check that macros is error-free before continuing.