Skip to content

Commit

Permalink
ICU-22818 Address review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankYFTang committed Aug 5, 2024
1 parent 50665c3 commit d36b057
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions icu4c/source/i18n/messageformat2_data_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1091,15 +1091,13 @@ MFDataModel::MFDataModel(const MFDataModel::Builder& builder, UErrorCode& errorC
U_ASSERT(builder.selectors != nullptr);
int32_t numVariants = builder.variants->size();
int32_t numSelectors = builder.selectors->size();
Variant* variants = copyVectorToArray<Variant>(*builder.variants, errorCode);
Expression* selectors = copyVectorToArray<Expression>(*builder.selectors, errorCode);
LocalArray<Variant> variants(copyVectorToArray<Variant>(*builder.variants, errorCode), errorCode);
LocalArray<Expression> selectors(copyVectorToArray<Expression>(*builder.selectors, errorCode), errorCode);
if (U_FAILURE(errorCode)) {
delete variants;
delete selectors;
bogus = true;
return;
}
body.emplace<Matcher>(Matcher(selectors, numSelectors, variants, numVariants));
body.emplace<Matcher>(Matcher(selectors.orphan(), numSelectors, variants.orphan(), numVariants));
}

U_ASSERT(builder.bindings != nullptr);
Expand Down

0 comments on commit d36b057

Please sign in to comment.