Jefffrey commented on code in PR #19551:
URL: https://github.com/apache/datafusion/pull/19551#discussion_r2656731135
##########
datafusion/functions/src/string/common.rs:
##########
@@ -49,90 +49,69 @@ impl Display for TrimType {
}
}
+/// Perform trim operation on input string with given pattern characters.
+///
+/// Returns (trimmed_str, start_offset) where start_offset is the byte offset
+/// from the beginning of the input string where the trimmed result starts.
+#[inline]
+fn perform_trim<'a>(
+ input: &'a str,
+ pattern: &[char],
+ trim_type: TrimType,
+) -> (&'a str, u32) {
+ match trim_type {
+ TrimType::Left => {
Review Comment:
I wonder if we can get speed gains by pulling this enum into a generic/trait
to avoid this matching inside the loop?
--
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]