diff options
author | Ronnie Sahlberg <ronniesahlberg@gmail.com> | 2010-10-08 13:14:14 +1100 |
---|---|---|
committer | Ronnie Sahlberg <ronniesahlberg@gmail.com> | 2011-02-18 10:05:09 +1100 |
commit | 0aa2282c9c26c87e55db6f9df435d5d932f2cbd1 (patch) | |
tree | 52e65002ff2e3892c1496e79bb043d9889503b50 | |
parent | c23f2e8beaf6ff589cdc0e7de537afbe3782f1de (diff) | |
download | samba-0aa2282c9c26c87e55db6f9df435d5d932f2cbd1.tar.gz samba-0aa2282c9c26c87e55db6f9df435d5d932f2cbd1.tar.xz samba-0aa2282c9c26c87e55db6f9df435d5d932f2cbd1.zip |
change the hash function to use the much better Jenkins hash
from the tdb library
cq S1020233
(This used to be ctdb commit b86feb6fe463dfdb67b2798491df18a4c434a430)
-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 88741e304d..1ff4c1f9aa 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)); } /* |