Removing redundant normalization data member

X-SVN-Rev: 8804
This commit is contained in:
Syn Wee Quek 2002-06-06 22:03:58 +00:00
parent bc379695a2
commit bf893316a4
2 changed files with 9 additions and 13 deletions

View File

@ -47,10 +47,10 @@ U_NAMESPACE_BEGIN
* UnicodeString target("The quick brown fox jumped over the lazy fox");
* UnicodeString pattern("fox");
*
* SearchIterator *iter = new StringSearch(pattern, target);
*
* for (int pos = iter->first(); pos != USEARCH_DONE;
* pos = iter->next()) {
* SearchIterator *iter = new StringSearch(pattern, target);
* UErrorCode error = U_ZERO_ERROR;
* for (int pos = iter->first(error); pos != USEARCH_DONE;
* pos = iter->next(error)) {
* printf("Found match at %d pos, length is %d\n", pos,
* iter.getMatchLength());
* }

View File

@ -2447,9 +2447,6 @@ U_CAPI UStringSearch * U_EXPORT2 usearch_openFromCollator(
result->collator = collator;
result->strength = ucol_getStrength(collator);
result->toNormalize = ucol_getAttribute(collator,
UCOL_NORMALIZATION_MODE,
status) == UCOL_ON;
result->ceMask = getMask(result->strength);
result->toShift =
ucol_getAttribute(collator, UCOL_ALTERNATE_HANDLING, status) ==
@ -2694,6 +2691,10 @@ U_CAPI void U_EXPORT2 usearch_setText( UStringSearch *strsrch,
strsrch->search->matchedIndex = USEARCH_DONE;
strsrch->search->matchedLength = 0;
strsrch->search->reset = TRUE;
if (strsrch->search->breakIter != NULL) {
ubrk_setText(strsrch->search->breakIter, text,
textlength, status);
}
}
}
}
@ -2724,9 +2725,6 @@ U_CAPI void U_EXPORT2 usearch_setCollator( UStringSearch *strsrch,
}
strsrch->collator = collator;
strsrch->strength = ucol_getStrength(collator);
strsrch->toNormalize = ucol_getAttribute(collator,
UCOL_NORMALIZATION_MODE,
status) == UCOL_ON;
strsrch->ceMask = getMask(strsrch->strength);
// if status is a failure, ucol_getAttribute returns UCOL_DEFAULT
strsrch->toShift =
@ -2740,6 +2738,7 @@ U_CAPI void U_EXPORT2 usearch_setCollator( UStringSearch *strsrch,
init_collIterate(collator, strsrch->search->text,
strsrch->search->textLength,
&(strsrch->textIter->iteratordata_));
strsrch->utilIter->iteratordata_.coll = collator;
}
}
}
@ -3036,9 +3035,6 @@ U_CAPI void U_EXPORT2 usearch_reset(UStringSearch *strsrch)
uint32_t varTop;
strsrch->strength = ucol_getStrength(strsrch->collator);
strsrch->toNormalize = ucol_getAttribute(strsrch->collator,
UCOL_NORMALIZATION_MODE,
&status) == UCOL_ON;
ceMask = getMask(strsrch->strength);
if (strsrch->ceMask != ceMask) {
strsrch->ceMask = ceMask;