RameshDhungel commented on issue #496: LANG-1523: Avoid unnecessary allocation in StringUtils.wrapIfMissing. URL: https://github.com/apache/commons-lang/pull/496#issuecomment-596217584 Hello, I just saw this issue in Jira, and if I understand the issue correctly. The StringUtils.wrapIfMissing is making a StringBuilder even when a string is already wrapped for example Str "xabx" with wrapper "x". Rather than not creating a instance of String Builder. What we can do is check if the string is already wrapped, if so then just return the String. This would avoid the String Builder being created.
---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services