iverase commented on a change in pull request #486: URL: https://github.com/apache/lucene/pull/486#discussion_r761839280
########## File path: lucene/core/src/java/org/apache/lucene/index/SortingCodecReader.java ########## @@ -170,45 +168,20 @@ public long size() { } @Override - public void visitDocIDs(PointValues.IntersectVisitor visitor) throws IOException { - sortingIntersectVisitor.setIntersectVisitor(visitor); - indexTree.visitDocIDs(sortingIntersectVisitor); + public void visitDocIDs(PointValues.DocIdsVisitor docIdsVisitor) throws IOException { + indexTree.visitDocIDs(docMap::oldToNew); } @Override - public void visitDocValues(PointValues.IntersectVisitor visitor) throws IOException { - sortingIntersectVisitor.setIntersectVisitor(visitor); - indexTree.visitDocValues(sortingIntersectVisitor); - } - } - - private static class SortingIntersectVisitor implements PointValues.IntersectVisitor { - - private final Sorter.DocMap docMap; - - private PointValues.IntersectVisitor visitor; - - SortingIntersectVisitor(Sorter.DocMap docMap) { - this.docMap = docMap; - } - - private void setIntersectVisitor(PointValues.IntersectVisitor visitor) { - this.visitor = visitor; - } - - @Override - public void visit(int docID) throws IOException { - visitor.visit(docMap.oldToNew(docID)); - } - - @Override - public void visit(int docID, byte[] packedValue) throws IOException { - visitor.visit(docMap.oldToNew(docID), packedValue); - } - - @Override - public PointValues.Relation compare(byte[] minPackedValue, byte[] maxPackedValue) { - return visitor.compare(minPackedValue, maxPackedValue); + public void visitDocValues( + PointValues.NodeComparator nodeComparator, + PointValues.DocIdsVisitor docIdsVisitor, + PointValues.DocValuesVisitor docValuesVisitor) + throws IOException { + indexTree.visitDocValues( + nodeComparator, + docMap::oldToNew, Review comment: likewise 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