You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2019/10/10 16:29:51 UTC

[GitHub] [lucene-solr] jpountz commented on a change in pull request #939: LUCENE-9003: Compute numDocs() lazily.

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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org