From 1bc8c66e1f77eb84371a33a2af1a36f1f12b2c51 Mon Sep 17 00:00:00 2001 From: George Rhoten Date: Tue, 12 Mar 2002 16:57:57 +0000 Subject: [PATCH] ICU-1036 Fix an HP/UX optimization bug with internal casing functions. X-SVN-Rev: 7944 --- icu4c/source/common/uchar.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/icu4c/source/common/uchar.c b/icu4c/source/common/uchar.c index 8ecefa516c..9d1bd32837 100644 --- a/icu4c/source/common/uchar.c +++ b/icu4c/source/common/uchar.c @@ -1035,6 +1035,8 @@ u_internalToLower(UChar32 c, UCharIterator *iter, const UChar *u; const uint32_t *pe=GET_EXCEPTIONS(props); uint32_t firstExceptionValue=*pe, specialCasing; + int32_t minLength; + if(HAVE_EXCEPTION_VALUE(firstExceptionValue, EXC_SPECIAL_CASING)) { i=EXC_SPECIAL_CASING; ++pe; @@ -1116,12 +1118,13 @@ u_internalToLower(UChar32 c, UCharIterator *iter, } else { /* get the special case mapping string from the data file */ u=ucharsTable+(specialCasing&0xffff); - length=(int32_t)(*u++)&0x1f; + length=(int32_t)((*u++)&0x1f); } /* copy the result string */ + minLength = (length < destCapacity) ? length : destCapacity; i=0; - while(i>24; + minLength = (length < destCapacity) ? length : destCapacity; /* copy the result string */ i=0; - while(i