Dandandan commented on code in PR #16877:
URL: https://github.com/apache/datafusion/pull/16877#discussion_r2232794927


##########
datafusion/functions/src/unicode/character_length.rs:
##########
@@ -136,56 +136,31 @@ where
     // string is ASCII only is relatively cheap.
     // If strings are ASCII only, count bytes instead.
     let is_array_ascii_only = array.is_ascii();
-    let array = if array.null_count() == 0 {
+    let nulls = array.nulls().cloned();

Review Comment:
   I think avoiding the null check (`array.is_null(i)`) makes things faster and 
it seems we don't need `0` as we always cloned `array.nulls().cloned()`



-- 
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