From d0b264bb956bba223b568e8fcd9116d673192234 Mon Sep 17 00:00:00 2001 From: George Rhoten Date: Fri, 5 May 2006 07:10:09 +0000 Subject: [PATCH] ICU-5195 Fix a performance issue found while fixing UTF-32 codepoint handling that stradle buffers. X-SVN-Rev: 19615 --- icu4c/source/common/ucnv_u8.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/icu4c/source/common/ucnv_u8.c b/icu4c/source/common/ucnv_u8.c index 1deafcd5f6c..7b977019ce0 100644 --- a/icu4c/source/common/ucnv_u8.c +++ b/icu4c/source/common/ucnv_u8.c @@ -1,6 +1,6 @@ /* ********************************************************************** -* Copyright (C) 2002-2005, International Business Machines +* Copyright (C) 2002-2006, International Business Machines * Corporation and others. All Rights Reserved. ********************************************************************** * file name: ucnv_u8.c @@ -101,6 +101,7 @@ static void ucnv_toUnicode_UTF8 (UConverterToUnicodeArgs * args, { inBytes = args->converter->mode; /* restore # of bytes to consume */ i = args->converter->toULength; /* restore # of bytes consumed */ + args->converter->toULength = 0; ch = args->converter->toUnicodeStatus;/*Stores the previously calculated ch from a previous call*/ args->converter->toUnicodeStatus = 0; @@ -165,7 +166,6 @@ morebytes: (isCESU8 ? i <= 3 : !UTF_IS_SURROGATE(ch))) { /* Normal valid byte when the loop has not prematurely terminated (i < inBytes) */ - args->converter->toULength = 0; if (ch <= MAXIMUM_UCS2) { /* fits in 16 bits */ @@ -230,6 +230,7 @@ static void ucnv_toUnicode_UTF8_OFFSETS_LOGIC (UConverterToUnicodeArgs * args, { inBytes = args->converter->mode; /* restore # of bytes to consume */ i = args->converter->toULength; /* restore # of bytes consumed */ + args->converter->toULength = 0; ch = args->converter->toUnicodeStatus;/*Stores the previously calculated ch from a previous call*/ args->converter->toUnicodeStatus = 0; @@ -292,7 +293,6 @@ morebytes: (isCESU8 ? i <= 3 : !UTF_IS_SURROGATE(ch))) { /* Normal valid byte when the loop has not prematurely terminated (i < inBytes) */ - args->converter->toULength = 0; if (ch <= MAXIMUM_UCS2) { /* fits in 16 bits */