rmuir commented on a change in pull request #399: URL: https://github.com/apache/lucene/pull/399#discussion_r732860233
########## File path: lucene/core/src/java/org/apache/lucene/index/DocsWithFieldSet.java ########## @@ -62,4 +62,9 @@ public long ramBytesUsed() { public DocIdSetIterator iterator() { return set != null ? new BitSetIterator(set, cost) : DocIdSetIterator.all(cost); } + + /** Return the number of documents of this set. */ + int cardinality() { + return cost; + } Review comment: not the fault of this change at all, but eventually it would be great to change this instance variable `cost` to be `cardinality` or something more intuitive (e.g. `add()` would then have `cardinality++` rather than `cost++`). I had to do a double-take when reviewing here. -- 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. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org