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


##########
datafusion/physical-expr-common/src/binary_view_map.rs:
##########
@@ -294,16 +294,13 @@ where
             let len = view_u128 as u32;
             let is_inline = len <= 12;
 
-            // Fetch the input value bytes once to avoid redundant memory
-            // access during hash resolution and insertion.
-            // For inline strings (<=12 bytes), extract bytes directly
-            // from the view (no memory fetch needed).
             // For non-inline strings (>12 bytes), fetch once from the array.
-            let view_bytes = view_u128.to_le_bytes();
-            let input_value: &[u8] = if is_inline {
-                &view_bytes[4..4 + len as usize]
-            } else {
+            // to avoid redundant memory access during hash resolution and 
insertion.
+            // Inline strings (<= 12 bytes) use u128 directly.
+            let input_value: &[u8] = if !is_inline {

Review Comment:
   Hmm can we just `values.value(i).as_ref()` to where it is used instead in 
the else branch ?



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to