alamb commented on code in PR #12125:
URL: https://github.com/apache/datafusion/pull/12125#discussion_r1730309834


##########
datafusion/functions-nested/src/array_has.rs:
##########
@@ -211,18 +211,12 @@ fn array_has_dispatch_for_scalar<O: OffsetSizeTrait>(
         if length == 0 {
             continue;
         }
-        // For nested lsit, check number of nulls
-        let null_count = eq_array.slice(start, length).null_count();
-        if null_count == length {
+        let sliced_array = eq_array.slice(start, length);
+        // For nested list, check number of nulls
+        if sliced_array.null_count() == length {
             continue;
         }
-
-        let number_of_true = eq_array.slice(start, length).true_count();
-        if number_of_true > 0 {
-            final_contained[i] = Some(true);
-        } else {
-            final_contained[i] = Some(false);
-        }
+        final_contained[i] = Some(sliced_array.true_count() > 0);

Review Comment:
   nice



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to