[ https://issues.apache.org/jira/browse/LUCENE-10586?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17540996#comment-17540996 ]
Adrien Grand commented on LUCENE-10586: --------------------------------------- +1 The reason is historical indeed. The earlier version of this class, Lucene40BlockTreeTermsReader, used to record metadata interleaved with the actual data. At some point, we moved metadata to a dedicated file, so that we could verify checksums upon opening the segment, so this required assigning `indexMetaIn` and `termsMetaIn` to either the data files or the metadata file depending on the version. It's good we can clean this up now that we're always reading metadata from the metadata file! > Minor refactoring in Lucene90BlockTreeTermsReader local variables: metaIn, > indexMetaIn, termsMetaIn > --------------------------------------------------------------------------------------------------- > > Key: LUCENE-10586 > URL: https://issues.apache.org/jira/browse/LUCENE-10586 > Project: Lucene - Core > Issue Type: Improvement > Reporter: Tomoko Uchida > Priority: Trivial > Time Spent: 10m > Remaining Estimate: 0h > > Those three local variables refer to the same {{IndexInput}} object (no > clone() is called). > {code} > indexMetaIn = termsMetaIn = metaIn; > {code} > I'm not sure but maybe there are some historical reasons. I wonder if it > would be better to have only one reference for the underlying {{IndexInput}} > object to make it a little easy to follow the code. -- This message was sent by Atlassian Jira (v8.20.7#820007) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org