ICU-1533 incorporate Doug's review comments

X-SVN-Rev: 6958
This commit is contained in:
Alan Liu 2001-11-16 22:37:05 +00:00
parent 1cad453ff9
commit dff39577af

View File

@ -239,12 +239,12 @@ CompoundTransliterator::~CompoundTransliterator() {
}
void CompoundTransliterator::freeTransliterators(void) {
for (int32_t i=0; i<count; ++i) {
if (trans != 0) {
for (int32_t i=0; i<count; ++i) {
delete trans[i];
}
}
delete[] trans;
}
trans = 0;
count = 0;
}
@ -310,11 +310,9 @@ void CompoundTransliterator::adoptTransliterators(Transliterator* adoptedTransli
// First free trans[] and set count to zero. Once this is done,
// orphan the filter. Set up the new trans[].
freeTransliterators();
UnicodeFilter *f = orphanFilter();
trans = adoptedTransliterators;
count = transCount;
computeMaximumContextLength();
adoptFilter(f);
setID(joinIDs(trans, count));
}