felipecrv commented on code in PR #41021:
URL: https://github.com/apache/arrow/pull/41021#discussion_r1553737891
##########
cpp/src/arrow/array/builder_nested.h:
##########
@@ -181,14 +181,13 @@ class ARROW_EXPORT VarLengthListLikeBuilder : public
ArrayBuilder {
if constexpr (is_list_view(TYPE::type_id)) {
sizes = array.GetValues<offset_type>(2);
}
+ const bool has_validity = array.buffers[0].data != NULLPTR;
const bool all_valid = !array.MayHaveLogicalNulls();
- const uint8_t* validity = array.HasValidityBitmap() ?
array.buffers[0].data : NULLPTR;
ARROW_RETURN_NOT_OK(Reserve(length));
for (int64_t row = offset; row < offset + length; row++) {
- const bool is_valid =
- all_valid || (validity && bit_util::GetBit(validity, array.offset +
row)) ||
- array.IsValid(row);
int64_t size = 0;
+ ARROW_COMPILER_ASSUME(has_validity == (array.buffers[0].data !=
NULLPTR));
Review Comment:
> Same question. It seems entirely redundant and therefore useless.
I agree it's not a strong example of the use of this macro, I have a better
example that would create conflicts with the work I'm doing on another PR.
--
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]