Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Unified Diff: source/i18n/dtitvinf.cpp

Issue 1621843002: ICU 56 update step 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@561
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/i18n/dtitvfmt.cpp ('k') | source/i18n/dtptngen.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/i18n/dtitvinf.cpp
diff --git a/source/i18n/dtitvinf.cpp b/source/i18n/dtitvinf.cpp
index 65be28469be4a007220a6db670131607590fc0a7..74f84882876d9757cd9de57c5171428cd11d7a7c 100644
--- a/source/i18n/dtitvinf.cpp
+++ b/source/i18n/dtitvinf.cpp
@@ -1,5 +1,5 @@
/*******************************************************************************
-* Copyright (C) 2008-2012, International Business Machines Corporation and
+* Copyright (C) 2008-2015, International Business Machines Corporation and
* others. All Rights Reserved.
*******************************************************************************
*
@@ -223,7 +223,7 @@ DateIntervalInfo::initializeData(const Locale& locale, UErrorCode& err)
char parentLocale[ULOC_FULLNAME_CAPACITY];
uprv_strcpy(parentLocale, locName);
UErrorCode status = U_ZERO_ERROR;
- Hashtable skeletonSet(FALSE, status);
+ Hashtable skeletonKeyPairs(FALSE, status);
if ( U_FAILURE(status) ) {
return;
}
@@ -277,10 +277,6 @@ DateIntervalInfo::initializeData(const Locale& locale, UErrorCode& err)
continue;
}
UnicodeString skeletonUniStr(skeleton, -1, US_INV);
- if ( skeletonSet.geti(skeletonUniStr) == 1 ) {
- continue;
- }
- skeletonSet.puti(skeletonUniStr, 1, status);
if ( uprv_strcmp(skeleton, gFallbackPatternTag) == 0 ) {
continue; // fallback
}
@@ -304,6 +300,12 @@ DateIntervalInfo::initializeData(const Locale& locale, UErrorCode& err)
if ( U_FAILURE(status) ) {
break;
}
+ UnicodeString keyUniStr(key, -1, US_INV);
+ UnicodeString skeletonKeyPair(skeletonUniStr + keyUniStr);
+ if ( skeletonKeyPairs.geti(skeletonKeyPair) == 1 ) {
+ continue;
+ }
+ skeletonKeyPairs.puti(skeletonKeyPair, 1, status);
UCalendarDateFields calendarField = UCAL_FIELD_COUNT;
if ( !uprv_strcmp(key, "y") ) {
@@ -481,7 +483,7 @@ DateIntervalInfo::getBestSkeleton(const UnicodeString& skeleton,
bestMatchDistanceInfo = 0;
int8_t fieldLength = sizeof(skeletonFieldWidth)/sizeof(skeletonFieldWidth[0]);
- int32_t pos = -1;
+ int32_t pos = UHASH_FIRST;
const UHashElement* elem = NULL;
while ( (elem = fIntervalPatterns->nextElement(pos)) != NULL ) {
const UHashTok keyTok = elem->key;
@@ -572,6 +574,9 @@ DateIntervalInfo::calendarFieldToIntervalIndex(UCalendarDateFields field,
case UCAL_MINUTE:
index = kIPI_MINUTE;
break;
+ case UCAL_SECOND:
+ index = kIPI_SECOND;
+ break;
default:
status = U_ILLEGAL_ARGUMENT_ERROR;
}
@@ -586,7 +591,7 @@ DateIntervalInfo::deleteHash(Hashtable* hTable)
if ( hTable == NULL ) {
return;
}
- int32_t pos = -1;
+ int32_t pos = UHASH_FIRST;
const UHashElement* element = NULL;
while ( (element = hTable->nextElement(pos)) != NULL ) {
const UHashTok valueTok = element->value;
@@ -649,7 +654,7 @@ DateIntervalInfo::copyHash(const Hashtable* source,
if ( U_FAILURE(status) ) {
return;
}
- int32_t pos = -1;
+ int32_t pos = UHASH_FIRST;
const UHashElement* element = NULL;
if ( source ) {
while ( (element = source->nextElement(pos)) != NULL ) {
« no previous file with comments | « source/i18n/dtitvfmt.cpp ('k') | source/i18n/dtptngen.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698