]> git.ozlabs.org Git - ccan/commit
tdb2: compare the extra 11 hash bits in the header.
authorRusty Russell <rusty@rustcorp.com.au>
Wed, 1 Dec 2010 13:10:05 +0000 (23:40 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Wed, 1 Dec 2010 13:10:05 +0000 (23:40 +1030)
commit115648946c7a78e87fb45eac6c1759a347d4c7f8
treec3ddfaddacfba732333f0649f07d5cb5507d93f1
parentf2c286c95f808520e0904b320dccc3680868f6ab
tdb2: compare the extra 11 hash bits in the header.

We already have 10 hash bits encoded in the offset itself; we only get
here incorrectly about 1 time in 1000, so it's a pretty minor
optimization at best.

Nonetheless, we have the information, so let's check it before
accessing the key.  This reduces the probability of a false keycmp by
another factor of 2000.
ccan/tdb2/hash.c