[
https://issues.apache.org/jira/browse/LUCENE-8552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16685649#comment-16685649
]
David Smiley commented on LUCENE-8552:
--------------------------------------
I'm glad you wish to contribute Christophe!
The intent is merely to recognize that there might be nothing to merge (<= 1
LeafReader). No new FieldInfos (or FieldInfo) need to be created. If zero
LeafReaders then we can return FieldInfos.EMPTY -- a recent addition.
{{FieldInfos.Builder}} takes {{FieldInfo}} not {{FieldInfos}}; maybe this was a
typo on your part.
I propose ignoring the 2nd part of my description concerning equals/hashCode.
> optimize getMergedFieldInfos for one-segment FieldInfos
> -------------------------------------------------------
>
> Key: LUCENE-8552
> URL: https://issues.apache.org/jira/browse/LUCENE-8552
> Project: Lucene - Core
> Issue Type: New Feature
> Reporter: David Smiley
> Priority: Minor
>
> FieldInfos.getMergedFieldInfos could trivially return the FieldInfos of the
> first and only LeafReader if there is only one LeafReader.
> Also... if there is more than one LeafReader, and if FieldInfos & FieldInfo
> implemented equals() & hashCode() (including a cached hashCode), maybe we
> could also call equals() iterating through the FieldInfos to see if we should
> bother adding it to the FieldInfos.Builder? Admittedly this is speculative;
> may not be worth the bother.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]