ppkarwasz commented on PR #1403:
URL: https://github.com/apache/commons-lang/pull/1403#issuecomment-3034608717

   Hi @SwethaMuthuvel,
   
   Thank you for your PR and your contribution to the project!
   
   I appreciate the intention behind simplifying the implementation using 
`String.lastIndexOf`. However, I don't believe this change is an improvement in 
this case. The current `StringUtils` method avoids unnecessary allocations by 
operating directly on `CharSequence` parameters. Your version converts both 
`CharSequence` arguments to `String`, which introduces two new object 
allocations — something we intentionally avoid in performance-sensitive utility 
code like this.
   


-- 
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: issues-unsubscr...@commons.apache.org

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

Reply via email to