File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -65,10 +65,12 @@ int getFinger(uint32_t x, int i) {
6565 return x;
6666 }
6767 if (i == 1 ) {
68+ // return (double) x / fingerMul;
6869// return x >> 10;
6970 return (int ) (((__uint128_t ) x * (invFingerMul + 1 )) >> 64 );
7071 }
7172 if (i == 2 ) {
73+ // return (double) x / fingerMul2;
7274// return x >> 20;
7375 return (int ) (((__uint128_t ) x * (invFingerMul2 + 1 )) >> 64 );
7476 }
@@ -296,9 +298,13 @@ Status XorFilter10_666<ItemType, HashFamily>::Contain(
296298 uint32_t h1 = reduce (r1, blockLength);
297299 uint32_t h2 = reduce (r2, blockLength);
298300 f += fingerprints[h0];
301+ // f += fingerprints[h1] / fingerMul;
299302 f += (((__uint128_t ) fingerprints[h1] * (invFingerMul + 1 )) >> 64 );
300303 f += (((__uint128_t ) fingerprints[h2] * (invFingerMul2 + 1 )) >> 64 );
301- return (f % fingerMul) == 0 ? Ok : NotFound;
304+ f -= (((__uint128_t ) f * (invFingerMul + 1 )) >> 64 ) * fingerMul;
305+ return (f == 0 ) ? Ok : NotFound;
306+ // http://www.icodeguru.com/Embedded/Hacker's-Delight/078.htm
307+ // return (((__uint128_t) f * (invFingerMul + 1)) >> 64) == f * 2996886421821121001L ? Ok : NotFound;
302308}
303309
304310} // namespace xorfilter
You can’t perform that action at this time.
0 commit comments