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



##########
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:
       Caller should ensure `_searchableLength <= _docIds.length`. If caller 
passes in wrong parameters, it is okay to through IndexOutOfBoundException. 
Similarly, we don't perform null check everywhere for simplicity and 
performance reason.




----------------------------------------------------------------
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