Copilot commented on code in PR #48211:
URL: https://github.com/apache/arrow/pull/48211#discussion_r3352112255
##########
cpp/src/parquet/bloom_filter.cc:
##########
@@ -220,12 +222,16 @@ void BlockSplitBloomFilter::InsertHashImpl(uint64_t hash)
{
const uint32_t bucket_index =
static_cast<uint32_t>(((hash >> 32) * (num_bytes_ /
kBytesPerFilterBlock)) >> 32);
const uint32_t key = static_cast<uint32_t>(hash);
- uint32_t* bitset32 = reinterpret_cast<uint32_t*>(data_->mutable_data());
+ uint32_t* raw_bitset32 = reinterpret_cast<uint32_t*>(data_->mutable_data());
for (int i = 0; i < kBitsSetPerBlock; i++) {
+ const int word_index = bucket_index * kBitsSetPerBlock + i;
Review Comment:
`word_index` is computed from a `uint32_t` (`bucket_index`) but stored in an
`int`, which can trigger narrowing / signedness warnings and is unnecessarily
inconsistent with the pointer indexing (the index is naturally unsigned). Use
an unsigned type for the index (or `size_t`) to avoid any potential truncation
and make the intent clear.
--
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]