Minor optimisation for the backwards iterator.

X-SVN-Rev: 5130
This commit is contained in:
Syn Wee Quek 2001-06-28 20:42:56 +00:00
parent a06786ebfc
commit d89bb9c5fc
4 changed files with 4 additions and 15 deletions

View file

@ -91,8 +91,7 @@ UBool CollationElementIterator::operator==(
}
// option comparison
result = this->m_data_->normalization_ == that.m_data_->normalization_
&& this->m_data_->reset_ == that.m_data_->reset_ &&
result = this->m_data_->reset_ == that.m_data_->reset_ &&
this->m_data_->iteratordata_.coll ==
that.m_data_->iteratordata_.coll;
@ -339,8 +338,6 @@ const CollationElementIterator& CollationElementIterator::operator=(
}
}
ucolelem->normalization_ = otherucolelem->normalization_;
ucolelem->reset_ = otherucolelem->reset_;
ucolelem->isWritable = TRUE;

View file

@ -1201,8 +1201,8 @@ inline uint32_t ucol_IGetPrevCE(const UCollator *coll, collIterate *data,
* Trailing combining class == 0.
* Note if pos is in the writablebuffer, norm is always 0
*/
if ((data->flags & UCOL_ITER_NORM) == 0 ||
ch < ZERO_CC_LIMIT_ ||
if (ch < ZERO_CC_LIMIT_ ||
(data->flags & UCOL_ITER_NORM) == 0 ||
(data->fcdPosition != NULL && data->fcdPosition <= data->pos)
|| data->string == data->pos) {
break;
@ -1240,7 +1240,7 @@ inline uint32_t ucol_IGetPrevCE(const UCollator *coll, collIterate *data,
/* attempt to handle contractions, after removal of the backwards
contraction
*/
if (!isAtStartPrevIterate(data) && ucol_contractionEndCP(ch, coll)) {
if (ucol_contractionEndCP(ch, coll) && !isAtStartPrevIterate(data)) {
result = getSpecialPrevCE(coll, UCOL_CONTRACTION, data, status);
}
else {

View file

@ -127,12 +127,6 @@ U_CAPI void init_collIterate(const UCollator *collator, const UChar *sourceStrin
struct UCollationElements
{
/**
* Normalization mode, not exactly the same as the data in collator_.
* If collation strength requested is UCOL_IDENTICAL, this mode will be
* UNORM_NONE otherwise it follows collator_.
*/
UNormalizationMode normalization_;
/**
* Struct wrapper for source data
*/
collIterate iteratordata_;

View file

@ -53,8 +53,6 @@ ucol_openElements(const UCollator *coll,
result = (UCollationElements *)uprv_malloc(sizeof(UCollationElements));
result->reset_ = TRUE;
result->normalization_ = UNORM_DEFAULT;
result->isWritable = FALSE;
if (text == NULL) {