]> granicus.if.org Git - icu/commitdiff
ICU-8879 Code review cleanups
authorAndy Heninger <andy.heninger@gmail.com>
Fri, 25 May 2012 19:51:34 +0000 (19:51 +0000)
committerAndy Heninger <andy.heninger@gmail.com>
Fri, 25 May 2012 19:51:34 +0000 (19:51 +0000)
X-SVN-Rev: 31862

icu4c/source/tools/gensprep/store.c

index 4245a9d06dd7c4b90574061960eb307c68477d79..30bd9fc50a3764dccda1008673e2f3f2b1525cc2 100644 (file)
@@ -356,7 +356,7 @@ storeMapping(uint32_t codepoint, uint32_t* mapping,int32_t length,
     
  
     UChar* map = NULL;
-    int16_t adjustedLen=0, i;
+    int16_t adjustedLen=0, i, j;
     uint16_t trieWord = 0;
     ValueStruct *value = NULL;
     uint32_t savedTrieWord = 0;
@@ -437,9 +437,8 @@ storeMapping(uint32_t codepoint, uint32_t* mapping,int32_t length,
 
     map = (UChar*) uprv_calloc(adjustedLen + 1, U_SIZEOF_UCHAR);
     
-    for (i=0; i<length;) {
-        UChar32 c = mapping[i];
-        U16_APPEND_UNSAFE(map, i, c);
+    for (i=0, j=0; i<length; i++) {
+        U16_APPEND_UNSAFE(map, j, mapping[i]);
     }
     
     value = (ValueStruct*) uprv_malloc(sizeof(ValueStruct));