dhruv9vats commented on code in PR #2676:
URL: https://github.com/apache/arrow-rs/pull/2676#discussion_r964541861
##########
arrow/src/array/equal/decimal.rs:
##########
@@ -37,10 +37,9 @@ pub(super) fn decimal_equal(
let lhs_values = &lhs.buffers()[0].as_slice()[lhs.offset() * size..];
let rhs_values = &rhs.buffers()[0].as_slice()[rhs.offset() * size..];
- let lhs_null_count = count_nulls(lhs.null_buffer(), lhs_start +
lhs.offset(), len);
- let rhs_null_count = count_nulls(rhs.null_buffer(), rhs_start +
rhs.offset(), len);
+ let has_nulls = contains_nulls(lhs.null_buffer(), lhs_start +
lhs.offset(), len);
- if lhs_null_count == 0 && rhs_null_count == 0 {
Review Comment:
Should we add a comment stating that the equality of null masks has already
been checked at this point? As this might not be apparent right away.
##########
arrow/src/array/equal/decimal.rs:
##########
@@ -37,10 +37,9 @@ pub(super) fn decimal_equal(
let lhs_values = &lhs.buffers()[0].as_slice()[lhs.offset() * size..];
let rhs_values = &rhs.buffers()[0].as_slice()[rhs.offset() * size..];
- let lhs_null_count = count_nulls(lhs.null_buffer(), lhs_start +
lhs.offset(), len);
- let rhs_null_count = count_nulls(rhs.null_buffer(), rhs_start +
rhs.offset(), len);
+ let has_nulls = contains_nulls(lhs.null_buffer(), lhs_start +
lhs.offset(), len);
- if lhs_null_count == 0 && rhs_null_count == 0 {
+ if !has_nulls {
Review Comment:
Would it be more appropriate if this were named `contains_nulls` too?
--
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]