neilconway commented on code in PR #21405:
URL: https://github.com/apache/datafusion/pull/21405#discussion_r3045940061


##########
datafusion/functions/src/unicode/rpad.rs:
##########
@@ -492,16 +484,15 @@ where
                         builder.append_value("");
                     }
                 } else {
-                    graphemes_buf.clear();
-                    graphemes_buf.extend(string.graphemes(true));
+                    let char_count = string.chars().count();
 
-                    if target_len < graphemes_buf.len() {
-                        let end: usize =
-                            graphemes_buf[..target_len].iter().map(|g| 
g.len()).sum();
-                        builder.append_value(&string[..end]);
+                    if target_len < char_count {

Review Comment:
   I refactored the code here as part of some improvements @martin-g suggested, 
so I think this is moot now.



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