| 471 | } |
| 472 | |
| 473 | void BlockSplitBloomFilter::InsertHashImpl(uint64_t hash) { |
| 474 | const uint32_t bucket_index = static_cast<uint32_t>(((hash >> 32) * NumBlocks()) >> 32); |
| 475 | const uint32_t key = static_cast<uint32_t>(hash); |
| 476 | uint32_t* bitset32 = reinterpret_cast<uint32_t*>(data_->mutable_data()); |
| 477 | |
| 478 | for (int i = 0; i < kBitsSetPerBlock; i++) { |
| 479 | // Calculate mask for key in the given bitset. |
| 480 | const uint32_t mask = UINT32_C(0x1) << ((key * SALT[i]) >> 27); |
| 481 | bitset32[bucket_index * kBitsSetPerBlock + i] |= mask; |
| 482 | } |
| 483 | } |
| 484 | |
| 485 | void BlockSplitBloomFilter::InsertHash(uint64_t hash) { InsertHashImpl(hash); } |
| 486 |
nothing calls this directly
no test coverage detected