edponce commented on a change in pull request #12032:
URL: https://github.com/apache/arrow/pull/12032#discussion_r776410855
##########
File path: cpp/src/arrow/compute/kernels/hash_aggregate.cc
##########
@@ -147,10 +152,13 @@ struct GrouperImpl : Grouper {
if (it_success.second) {
// new key; update offsets and key_bytes
++num_groups_;
- auto next_key_offset = static_cast<int32_t>(key_bytes_.size());
- key_bytes_.resize(next_key_offset + key_length);
- offsets_.push_back(next_key_offset + key_length);
- memcpy(key_bytes_.data() + next_key_offset, key.c_str(), key_length);
+ if (key_length != 0) {
Review comment:
Nit: `key_length > 0` is a bit more representable given that
`key_length` is a signed int.
--
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]