pitrou commented on code in PR #33776:
URL: https://github.com/apache/arrow/pull/33776#discussion_r1092013392
##########
cpp/src/parquet/bloom_filter.cc:
##########
@@ -128,7 +190,7 @@ void BlockSplitBloomFilter::SetMask(uint32_t key,
BlockMask& block_mask) const {
bool BlockSplitBloomFilter::FindHash(uint64_t hash) const {
const uint32_t bucket_index =
- static_cast<uint32_t>((hash >> 32) & (num_bytes_ / kBytesPerFilterBlock
- 1));
+ static_cast<uint32_t>(((hash >> 32) * (num_bytes_ /
kBytesPerFilterBlock)) >> 32);
uint32_t key = static_cast<uint32_t>(hash);
uint32_t* bitset32 = reinterpret_cast<uint32_t*>(data_->mutable_data());
Review Comment:
This would be better as:
```suggestion
const uint32_t* bitset32 = reinterpret_cast<const
uint32_t*>(data_->data());
```
##########
cpp/src/parquet/bloom_filter.cc:
##########
@@ -128,7 +190,7 @@ void BlockSplitBloomFilter::SetMask(uint32_t key,
BlockMask& block_mask) const {
bool BlockSplitBloomFilter::FindHash(uint64_t hash) const {
const uint32_t bucket_index =
- static_cast<uint32_t>((hash >> 32) & (num_bytes_ / kBytesPerFilterBlock
- 1));
+ static_cast<uint32_t>(((hash >> 32) * (num_bytes_ /
kBytesPerFilterBlock)) >> 32);
uint32_t key = static_cast<uint32_t>(hash);
Review Comment:
Make this `const`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]