Fixes bug 3482222 filed in the bug tracker.

This commit is contained in:
Fabiano C. Botelho 2013-04-16 00:50:24 -07:00
parent 9e434d41d0
commit c1a9eb164e
2 changed files with 7 additions and 7 deletions

View File

@ -530,7 +530,7 @@ cmph_uint32 bmz_search(cmph_t *mphf, const char *key, cmph_uint32 keylen)
cmph_uint32 h1 = hash(bmz->hashes[0], key, keylen) % bmz->n;
cmph_uint32 h2 = hash(bmz->hashes[1], key, keylen) % bmz->n;
DEBUGP("key: %.*s h1: %u h2: %u\n", keylen, key, h1, h2);
if (h1 == h2 && ++h2 > bmz->n) h2 = 0;
if (h1 == h2 && ++h2 >= bmz->n) h2 = 0;
DEBUGP("key: %.*s g[h1]: %u g[h2]: %u edges: %u\n", keylen, key, bmz->g[h1], bmz->g[h2], bmz->m);
return bmz->g[h1] + bmz->g[h2];
}
@ -620,6 +620,6 @@ cmph_uint32 bmz_search_packed(void *packed_mphf, const char *key, cmph_uint32 ke
register cmph_uint32 h1 = hash_packed(h1_ptr, h1_type, key, keylen) % n;
register cmph_uint32 h2 = hash_packed(h2_ptr, h2_type, key, keylen) % n;
if (h1 == h2 && ++h2 > n) h2 = 0;
if (h1 == h2 && ++h2 >= n) h2 = 0;
return (g_ptr[h1] + g_ptr[h2]);
}