code: func (itr *mergeSegmentIterator) next() (s0, s1 *rowSegment) {
  	// Find current segments.
  	if len(itr.a0) > 0 {
  		s0 = &itr.a0[0]
  	}
  	if len(itr.a1) > 0 {
  		s1 = &itr.a1[0]
  	}
  
  	// Return if either or both are nil.
  	if s0 == nil && s1 == nil {
  		return
  	} else if s0 == nil {
  		itr.a1 = itr.a1[1:]
  		return
  	} else if s1 == nil {
  		itr.a0 = itr.a0[1:]
  		return
  	}
  
  	// Otherwise determine which is first.
  	if s0.shard < s1.shard {
  		itr.a0 = itr.a0[1:]
  		return s0, nil
  	} else if s0.shard > s1.shard {
  		itr.a1 = itr.a1[1:]
  		return s1, nil
  	}
  
  	// Return both if shards are equal.
  	itr.a0, itr.a1 = itr.a0[1:], itr.a1[1:]
  	return s0, s1
  }
docs: // next returns the next set of segments.