code: func splitByRange(ds []dirMeta, tr int64) [][]dirMeta {
  	var splitDirs [][]dirMeta
  
  	for i := 0; i < len(ds); {
  		var (
  			group []dirMeta
  			t0    int64
  			m     = ds[i].meta
  		)
  		// Compute start of aligned time range of size tr closest to the current block's start.
  		if m.MinTime >= 0 {
  			t0 = tr * (m.MinTime / tr)
  		} else {
  			t0 = tr * ((m.MinTime - tr + 1) / tr)
  		}
  		// Skip blocks that don't fall into the range. This can happen via mis-alignment or
  		// by being the multiple of the intended range.
  		if m.MaxTime > t0+tr {
  			i++
  			continue
  		}
  
  		// Add all dirs to the current group that are within [t0, t0+tr].
  		for ; i < len(ds); i++ {
  			// Either the block falls into the next range or doesn't fit at all (checked above).
  			if ds[i].meta.MaxTime > t0+tr {
  				break
  			}
  			group = append(group, ds[i])
  		}
  
  		if len(group) > 0 {
  			splitDirs = append(splitDirs, group)
  		}
  	}
  
  	return splitDirs
  }
docs: // splitByRange splits the directories by the time range. The range sequence starts at 0.
  //
  // For example, if we have blocks [0-10, 10-20, 50-60, 90-100] and the split range tr is 30
  // it returns [0-10, 10-20], [50-60], [90-100].