File tree 2 files changed +3
-3
lines changed
src/segment/filter/blocked_bloom
2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -103,15 +103,15 @@ impl Builder {
103
103
h1 = h1. wrapping_add ( h2) ;
104
104
h2 = h2. wrapping_mul ( i) ;
105
105
106
- let idx = h1 % ( CACHE_LINE_BYTES as u64 ) ;
106
+ let idx = h1 % ( CACHE_LINE_BYTES as u64 * 8 ) ;
107
107
108
108
self . inner
109
109
. enable_bit ( Self :: get_bit_idx ( block_idx as usize , idx as usize ) ) ;
110
110
}
111
111
}
112
112
113
113
pub fn get_bit_idx ( block_idx : usize , idx_in_block : usize ) -> usize {
114
- block_idx * CACHE_LINE_BYTES as usize + idx_in_block
114
+ block_idx * CACHE_LINE_BYTES * 8 + idx_in_block
115
115
}
116
116
117
117
/// Gets the hash of a key.
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ impl AMQFilter for BlockedBloomFilter {
48
48
h1 = h1. wrapping_add ( h2) ;
49
49
h2 = h2. wrapping_mul ( i) ;
50
50
51
- let idx = h1 % ( CACHE_LINE_BYTES as u64 ) ;
51
+ let idx = h1 % ( CACHE_LINE_BYTES as u64 * 8 ) ;
52
52
53
53
// NOTE: should be in bounds because of modulo
54
54
#[ allow( clippy:: expect_used, clippy:: cast_possible_truncation) ]
You can’t perform that action at this time.
0 commit comments