You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "spacewander (via GitHub)" <gi...@apache.org> on 2023/03/21 02:08:06 UTC

[GitHub] [apisix] spacewander commented on a diff in pull request #8358: refactor: refactor get last index func in log rotate plugin

spacewander commented on code in PR #8358:
URL: https://github.com/apache/apisix/pull/8358#discussion_r1142827655


##########
apisix/core/utils.lua:
##########
@@ -335,4 +337,19 @@ end
 _M.resolve_var = resolve_var
 
 
+function _M.get_last_index(str, key)
+    local str_rev = str_reverse(str)
+    local key_rev = str_reverse(key)
+    local idx, _ = str_find(str_rev, key_rev)

Review Comment:
   We can use plain string find here?



-- 
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: notifications-unsubscribe@apisix.apache.org

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