velox/exec/TreeOfLosers.h
Stream* next() {
    if (UNLIKELY(lastIndex_ == kEmpty)) {
      lastIndex_ = first(0);
    } else {
      lastIndex_ = propagate(
          parent(firstStream_ + lastIndex_),
          streams_[lastIndex_]->hasData() ? lastIndex_ : kEmpty);
    }
    return lastIndex_ == kEmpty ? nullptr : streams_[lastIndex_].get();
  }
// Returns the stream with the lowest first element. The caller is
// expected to pop off the first element of the stream before
// calling this again. Returns nullptr when all streams are at end.
Returns the stream with the lowest first element. The caller is
expected to pop off the first element of the stream before
calling this again. Returns nullptr when all streams are at end.
Returns the stream with the lowest first element . The caller is expected to pop off the first element of the stream before calling this again . Returns nullptr when all streams are at end .
Stream* next() {
    if (UNLIKELY(lastIndex_ == kEmpty)) {
      lastIndex_ = first(0);
    } else {
      lastIndex_ = propagate(
          parent(firstStream_ + lastIndex_),
          streams_[lastIndex_]->hasData() ? lastIndex_ : kEmpty);
    }
    return lastIndex_ == kEmpty ? nullptr : streams_[lastIndex_].get();
  }
Stream * next ( ) { if ( UNLIKELY ( lastIndex_ == kEmpty ) ) { lastIndex_ = first ( 0 ) ; } else { lastIndex_ = propagate ( parent ( firstStream_ + lastIndex_ ) , streams_ [ lastIndex_ ] -> hasData ( ) ? lastIndex_ : kEmpty ) ; } return lastIndex_ == kEmpty ? nullptr : streams_ [ lastIndex_ ] . get ( ) ; }
Returns the stream with the lowest first element.
Returns the stream with the lowest first element .