X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/b25be06635768807f8f693286fa73bb2297bb06c..4388f060552cc537e71e957d32f35e9d75a61233:/icuSources/common/uhash.c diff --git a/icuSources/common/uhash.c b/icuSources/common/uhash.c index 0018167d..5dd6ba34 100644 --- a/icuSources/common/uhash.c +++ b/icuSources/common/uhash.c @@ -1,6 +1,6 @@ /* ****************************************************************************** -* Copyright (C) 1997-2009, International Business Machines +* Copyright (C) 1997-2011, International Business Machines * Corporation and others. All Rights Reserved. ****************************************************************************** * Date Name Description @@ -15,6 +15,7 @@ #include "cstring.h" #include "cmemory.h" #include "uassert.h" +#include "ustr_imp.h" /* This hashtable is implemented as a double hash. All elements are * stored in a single array with no secondary storage for collision @@ -832,53 +833,26 @@ uhash_tokp(void* p) { * PUBLIC Key Hash Functions ********************************************************************/ -/* - Compute the hash by iterating sparsely over about 32 (up to 63) - characters spaced evenly through the string. For each character, - multiply the previous hash value by a prime number and add the new - character in, like a linear congruential random number generator, - producing a pseudorandom deterministic value well distributed over - the output range. [LIU] -*/ - -#define STRING_HASH(TYPE, STR, STRLEN, DEREF) \ - int32_t hash = 0; \ - const TYPE *p = (const TYPE*) STR; \ - if (p != NULL) { \ - int32_t len = (int32_t)(STRLEN); \ - int32_t inc = ((len - 32) / 32) + 1; \ - const TYPE *limit = p + len; \ - while (p