From: Ronnie Sahlberg Date: Fri, 8 Oct 2010 02:14:14 +0000 (+1100) Subject: change the hash function to use the much better Jenkins hash X-Git-Url: http://git.samba.org/?p=metze%2Fctdb%2Fwip.git;a=commitdiff_plain;h=f7e91ae905cd61249028e15f2cb509ea69f10b9e change the hash function to use the much better Jenkins hash from the tdb library cq S1020233 --- diff --git a/common/ctdb_util.c b/common/ctdb_util.c index 4acfa3f3..749b9c28 100644 --- a/common/ctdb_util.c +++ b/common/ctdb_util.c @@ -99,14 +99,7 @@ bool ctdb_same_address(struct ctdb_address *a1, struct ctdb_address *a2) */ uint32_t ctdb_hash(const TDB_DATA *key) { - uint32_t value; /* Used to compute the hash value. */ - uint32_t i; /* Used to cycle through random values. */ - - /* Set the initial value from the key size. */ - for (value = 0x238F13AF * key->dsize, i=0; i < key->dsize; i++) - value = (value + (key->dptr[i] << (i*5 % 24))); - - return (1103515243 * value + 12345); + return tdb_jenkins_hash(discard_const(key)); } /*