[GitHub] ant pull request #43: Fix the problem of using '+=' operator to concatenate ...

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] ant pull request #43: Fix the problem of using '+=' operator to concatenate ...

bodewig
GitHub user BruceKuiLiu opened a pull request:

    https://github.com/apache/ant/pull/43

    Fix the problem of using '+=' operator to concatenate strings in a loop

    The method is building a String using concatenation in a loop.
    In each iteration, the String is converted to a StringBuilder, appended to, and converted back to a String.
    This can lead to a cost quadratic in the number of iterations, as the growing string is recopied in each iteration.
    Better performance can be obtained by using a StringBuilder explicitly.
    http://findbugs.sourceforge.net/bugDescriptions.html#SBSC_USE_STRINGBUFFER_CONCATENATION

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/BruceKuiLiu/ant master3

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/ant/pull/43.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #43
   
----
commit cc37652438f3ff345af78b6dc45e8108f02bd402
Author: Kui LIU <[hidden email]>
Date:   2017-10-11T13:01:48Z

    Fix the problem of using '+=' operator to concatenate strings a in a loop.
   
    The method is building a String using concatenation in a loop.
    In each iteration, the String is converted to a StringBuilder, appended to, and converted back to a String.
    This can lead to a cost quadratic in the number of iterations, as the growing string is recopied in each iteration.
    Better performance can be obtained by using a StringBuilder explicitly.
    http://findbugs.sourceforge.net/bugDescriptions.html#SBSC_USE_STRINGBUFFER_CONCATENATION

----


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] ant pull request #43: Fix the problem of using '+=' operator to concatenate ...

bodewig
Github user asfgit closed the pull request at:

    https://github.com/apache/ant/pull/43


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] ant issue #43: Fix the problem of using '+=' operator to concatenate strings...

bodewig
In reply to this post by bodewig
Github user bodewig commented on the issue:

    https://github.com/apache/ant/pull/43
 
    merged, thanks!


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]