You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "zclllyybb (via GitHub)" <gi...@apache.org> on 2023/04/15 13:13:41 UTC

[GitHub] [doris] zclllyybb commented on a diff in pull request #18580: [feature](function) Add new parameters to 'trim'.

zclllyybb commented on code in PR #18580:
URL: https://github.com/apache/doris/pull/18580#discussion_r1167540940


##########
be/src/util/simd/vstring_function.h:
##########
@@ -122,6 +122,101 @@ class VStringFunctions {
         return rtrim(ltrim(str));
     }
 
+    static StringRef rtrim(const StringRef& str, const StringRef& rhs) {
+        if (str.size == 0 || rhs.size == 0) {
+            return str;
+        }
+        if (rhs.size == 1) {

Review Comment:
   not required for this pr but may be considerable: for most situations these function to be used, the needles are likely to be constant. So we can also use SIMD bitwise compare to optimize them. just give code below a little change will make it.



-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org