chenboat commented on a change in pull request #5444:
URL: https://github.com/apache/incubator-pinot/pull/5444#discussion_r433642778



##########
File path: 
pinot-core/src/main/java/org/apache/pinot/core/operator/dociditerators/ArrayBasedDocIdIterator.java
##########
@@ -36,37 +35,15 @@ public ArrayBasedDocIdIterator(int[] docIds, int 
searchableLength) {
 
   @Override
   public int next() {
-    if (_currentDocId == Constants.EOF) {
-      return Constants.EOF;
-    }
-    if (++_currentIndex == _searchableLength) {
-      _currentDocId = Constants.EOF;
+    if (_nextIndex < _searchableLength) {
+      return _docIds[_nextIndex++];

Review comment:
       what happens if _nextIndex >= docIds.length? should we have a array 
length check?




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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to