change the hash function to use the much better Jenkins hash
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Fri, 8 Oct 2010 02:14:14 +0000 (13:14 +1100)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Thu, 17 Feb 2011 23:05:09 +0000 (10:05 +1100)
from the tdb library

cq S1020233

common/ctdb_util.c

index 88741e304d744145d25afc1f98e77536cd5c8e28..1ff4c1f9aa2052cb97b46c54af6c579ab9ed430f 100644 (file)
@@ -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));
 }
 
 /*