kingluo commented on code in PR #8358: URL: https://github.com/apache/apisix/pull/8358#discussion_r1194575889
########## apisix/core/utils.lua: ########## @@ -335,6 +336,21 @@ end _M.resolve_var = resolve_var +function _M.get_last_index(str, key) Review Comment: for such a basic string operation, I suggest reusing the `pl.stringx` from Penlight library. After all, we already import this lib in our code base. Never reinvent the wheel unless you have to. https://lunarmodules.github.io/Penlight/libraries/pl.stringx.html#rfind Example: ``` > print(require("pl.stringx").rfind("apisix__1928", "__")) 7 ``` -- 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]
