diff options
author | Ronnie Sahlberg <ronniesahlberg@gmail.com> | 2010-10-08 13:14:14 +1100 |
---|---|---|
committer | Ronnie Sahlberg <ronniesahlberg@gmail.com> | 2010-10-08 13:18:18 +1100 |
commit | 6a7ecb7f423151a85f088d5f20928989d7376d38 (patch) | |
tree | ee640cd626d9de6795092506e9beb49355d16fdf /ctdb/common/ctdb_util.c | |
parent | 8bdaa7d41f4aad5f5f245b364816aba6f52c0304 (diff) | |
download | samba-6a7ecb7f423151a85f088d5f20928989d7376d38.tar.gz samba-6a7ecb7f423151a85f088d5f20928989d7376d38.tar.xz samba-6a7ecb7f423151a85f088d5f20928989d7376d38.zip |
change the hash function to use the much better Jenkins hash
from the tdb library
cq S1020233
(This used to be ctdb commit f7e91ae905cd61249028e15f2cb509ea69f10b9e)
Diffstat (limited to 'ctdb/common/ctdb_util.c')
-rw-r--r-- | ctdb/common/ctdb_util.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/ctdb/common/ctdb_util.c b/ctdb/common/ctdb_util.c index 4acfa3f33e..749b9c286f 100644 --- a/ctdb/common/ctdb_util.c +++ b/ctdb/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)); } /* |