ICU-21533 Lazily create the internal break iterator used in StringSearch, and improve error handling.

Change NULL to nullptr.
This commit is contained in:
Jeff Genovy 2020-11-17 19:02:15 -08:00
parent e5502fe862
commit 0a478416d2
2 changed files with 254 additions and 175 deletions
icu4c/source/i18n

File diff suppressed because it is too large Load diff

View file

@ -135,8 +135,8 @@ struct USearch {
UBool isOverlap;
UBool isCanonicalMatch;
int16_t elementComparisonType;
UBreakIterator *internalBreakIter; //internal character breakiterator
UBreakIterator *breakIter;
UBreakIterator *internalBreakIter; // internal character breakiterator, lazily created.
UBreakIterator *breakIter; // caller provided character breakiterator
// value USEARCH_DONE is the default value
// if we are not at the start of the text or the end of the text,
// depending on the iteration direction and matchedIndex is USEARCH_DONE