Skip to content

Commit ad03a5c

Browse files
committed
chore(core): regex cleanup 🙀
- more comments For: #9121
1 parent 548acaa commit ad03a5c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core/src/ldml/ldml_transforms.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,7 @@ transform_entry::match(const std::u32string &input) const {
421421
UErrorCode status = U_ZERO_ERROR;
422422
const std::u16string matchstr = km::kbp::kmx::u32string_to_u16string(input);
423423
icu::UnicodeString matchustr = icu::UnicodeString(matchstr.data(), (int32_t)matchstr.length());
424+
// TODO-LDML: create a new Matcher every time. These could be cached and reset.
424425
std::unique_ptr<icu::RegexMatcher> matcher(fFromPattern->matcher(matchustr, status));
425426
assert(U_SUCCESS(status));
426427

@@ -448,7 +449,7 @@ transform_entry::apply(const std::u32string &input, size_t matchLen) const {
448449
// TODO-LDML: Really? can't go from u32 to UnicodeString?
449450

450451
assert(fFromPattern);
451-
// TODO-LDML: simple approach, new regex every time
452+
// TODO-LDML: simple approach, create a new Matcher every time. These could be cached and reset.
452453
// TODO-LDML: Really? can't go from u32 to UnicodeString?
453454
UErrorCode status = U_ZERO_ERROR;
454455

0 commit comments

Comments
 (0)