[ 
https://issues.apache.org/jira/browse/LANG-1523?focusedWorklogId=399871&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-399871
 ]

ASF GitHub Bot logged work on LANG-1523:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 08/Mar/20 15:34
            Start Date: 08/Mar/20 15:34
    Worklog Time Spent: 10m 
      Work Description: RameshDhungel commented on pull request #503: 
[LANG-1523] Avoid unnecessary allocation in StringUtils.wrapIfMissing
URL: https://github.com/apache/commons-lang/pull/503
 
 
   It seems like the String Builder is being created after checking if the str 
or the wrapper is null. What we can do is check if the str is already wrapped, 
if so then just return the str. 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:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 399871)
    Time Spent: 1h  (was: 50m)

> Avoid unnecessary allocation in StringUtils.wrapIfMissing
> ---------------------------------------------------------
>
>                 Key: LANG-1523
>                 URL: https://issues.apache.org/jira/browse/LANG-1523
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.*
>    Affects Versions: 3.9
>            Reporter: Edgar Asatryan
>            Priority: Major
>             Fix For: 3.10
>
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> The *StringUtils.wrapIfMissing* creates a new instance of *StringBuilder* 
> regardless of whether the input is wrapped or not.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to