diff --git a/icu4c/source/i18n/ucol_elm.cpp b/icu4c/source/i18n/ucol_elm.cpp index fe4a982c6f7..e81d5557133 100644 --- a/icu4c/source/i18n/ucol_elm.cpp +++ b/icu4c/source/i18n/ucol_elm.cpp @@ -496,9 +496,9 @@ static int uprv_uca_setMaxExpansion(uint32_t endexpansion, uint8_t *sizeshiftpos = pexpansionsize + (shiftpos - pendexpansionce); /* okay need to rearrange the array into sorted order */ - if (shiftsize == 0 || *(pendexpansionce + pos) < endexpansion) { - *(pendexpansionce + pos + 1) = endexpansion; - *(pexpansionsize + pos + 1) = expansionsize; + if (shiftsize == 0 /*|| *(pendexpansionce + pos) < endexpansion*/) { /* the commented part is actually both redundant and dangerous */ + *(pendexpansionce + pos) = endexpansion; + *(pexpansionsize + pos) = expansionsize; } else { uprv_memmove(shiftpos + 1, shiftpos, shiftsize * sizeof(int32_t));