[
https://issues.apache.org/jira/browse/LUCENE-6885?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14989715#comment-14989715
]
Christine Poerschke commented on LUCENE-6885:
---------------------------------------------
Fair point re: code complexity. The intention was to avoid allocation of the
{{segmentReaders}} when they will remain empty because {{oldReaders}} is null
and to allocate as many elements as will be needed (usually that would be more
than the default 10 initial elements).
Would it be clearer to do
{code}
final Map<String,Integer> segmentReaders = (oldReaders == null ? null : new
HashMap<>(oldReaders.size()));
{code}
i.e. no lazy initialisation as such but the {{segmentReaders == null}} check
later on would remain?
> StandardDirectoryReader (initialCapacity) tweaks
> ------------------------------------------------
>
> Key: LUCENE-6885
> URL: https://issues.apache.org/jira/browse/LUCENE-6885
> Project: Lucene - Core
> Issue Type: Task
> Reporter: Christine Poerschke
> Assignee: Christine Poerschke
> Priority: Minor
> Attachments: LUCENE-6885.patch
>
>
> proposed patch against trunk to follow
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]