jpountz commented on a change in pull request #939: LUCENE-9003: Compute 
numDocs() lazily.
URL: https://github.com/apache/lucene-solr/pull/939#discussion_r333618991
 
 

 ##########
 File path: 
lucene/core/src/java/org/apache/lucene/index/BaseCompositeReader.java
 ##########
 @@ -89,7 +88,6 @@ protected BaseCompositeReader(R[] subReaders) throws 
IOException {
 
     this.maxDoc = Math.toIntExact(maxDoc);
     starts[subReaders.length] = this.maxDoc;
-    this.numDocs = Math.toIntExact(numDocs);
 
 Review comment:
   I think it's not necessary on numDocs. By the time we compute numDocs(), we 
already checked that maxDoc values summed up to a number that doesn't overflow. 
Since numDocs is less than or equal to maxDoc, the sum of numDocs shouldn't 
overflow either?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to