- /* udata_getCacheHashTable()
- * Get the hash table used to store the data cache entries.
- * Lazy create it if it doesn't yet exist.
- */
-static UHashtable *udata_getHashTable() {
- UErrorCode err = U_ZERO_ERROR;
- UBool cacheIsInitialized;
- UHashtable *tHT = NULL;
-
- UMTX_CHECK(NULL, (gCommonDataCache != NULL), cacheIsInitialized);
-
- if (cacheIsInitialized) {
- return gCommonDataCache;
- }
-
- tHT = uhash_open(uhash_hashChars, uhash_compareChars, NULL, &err);
- /* Check for null pointer. */
- if (tHT == NULL) {
- return NULL; /* TODO: Handle this error better. */
+static void udata_initHashTable() {
+ UErrorCode err = U_ZERO_ERROR;
+ U_ASSERT(gCommonDataCache == NULL);
+ gCommonDataCache = uhash_open(uhash_hashChars, uhash_compareChars, NULL, &err);
+ if (U_FAILURE(err)) {
+ // TODO: handle errors better.
+ gCommonDataCache = NULL;