HappenLee commented on code in PR #43921:
URL: https://github.com/apache/doris/pull/43921#discussion_r1843118260


##########
be/src/vec/functions/function_ip.h:
##########
@@ -1318,9 +1321,10 @@ class FunctionCutIPv6 : public IFunction {
                                 get_name());
             }
 
-            UInt8 bytes_to_cut_count = is_ipv4_mapped(address) ? 
bytes_to_cut_for_ipv4_count
-                                                               : 
bytes_to_cut_for_ipv6_count;
-            cut_address(address, pos, bytes_to_cut_count);
+            UInt8 bytes_to_cut_count = is_ipv4_mapped(ipv6_address_data)
+                                               ? bytes_to_cut_for_ipv4_count
+                                               : bytes_to_cut_for_ipv6_count;
+            cut_address(ipv6_address_data, pos, bytes_to_cut_count);

Review Comment:
   Add detail comment for the code. And consider we pass reference or value 
replace by ptr



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