[
https://issues.apache.org/jira/browse/LUCENE-7691?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15862538#comment-15862538
]
Michael Braun commented on LUCENE-7691:
---------------------------------------
I had already done this as an exercise earlier - let me know what parts you
like / don't like from this. This is limited just to code only where we know
the exact size of the collection, not an upper bound, and I only looked for new
ArrayList, so .toArray was not part of the scope. Really interesting article -
just read through it. Let me know what you think about the PR.
> ArrayLists should be created with explicit size if known
> --------------------------------------------------------
>
> Key: LUCENE-7691
> URL: https://issues.apache.org/jira/browse/LUCENE-7691
> Project: Lucene - Core
> Issue Type: Improvement
> Reporter: Michael Braun
> Priority: Trivial
>
> Many places in Lucene there are ArrayLists being created with no explicit
> size set even when the exact size is known in advance. In these places, the
> size should be passed in so the underlying array is sized correctly the first
> time.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]