[ 
https://issues.apache.org/jira/browse/LUCENE-5372?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13851447#comment-13851447
 ] 

Dawid Weiss commented on LUCENE-5372:
-------------------------------------

Looks good to me and I think it's applicable to 4.x and 5.x (StringBuilder 
requires Java >= 1.5 but both of these branches do, right)?

> IntArray toString has O(n^2) performance
> ----------------------------------------
>
>                 Key: LUCENE-5372
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5372
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: core/index
>            Reporter: Joshua Hartman
>            Priority: Minor
>             Fix For: 5.0, 4.7
>
>         Attachments: 5372.patch
>
>
> This is pretty minor, but I found a few issues with the toString 
> implementations while looking through the facet data structures.
> The most egregious is the use of string concatenation in the IntArray class. 
> I have fixed that using StringBuilders. I also noticed that other classes 
> were using StringBuffer instead of StringBuilder. According to the javadoc,
> "This class is designed for use as a drop-in replacement for StringBuffer in 
> places where the string buffer was being used by a single thread (as is 
> generally the case). Where possible, it is recommended that this class be 
> used in preference to StringBuffer as it will be faster under most 
> implementations."



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to