code: func (c *Container) arrayToRun(numRuns int32) {
  	statsHit("arrayToRun")
  	array := c.array()
  	c.typ = containerRun
  	c.mapped = false
  	// return early if empty
  	if c.n == 0 {
  		c.setRuns(nil)
  		return
  	}
  	if numRuns == 0 {
  		numRuns = arrayCountRuns(array)
  	}
  
  	runs := make([]interval16, 0, numRuns)
  	start := array[0]
  	for i, v := range array[1:] {
  		if v-array[i] > 1 {
  			// if current-previous > 1, one run ends and another begins
  			runs = append(runs, interval16{start, array[i]})
  			start = v
  		}
  	}
  	// append final run
  	runs = append(runs, interval16{start, array[c.n-1]})
  	c.setRuns(runs)
  }
docs: // arrayToRun converts from array format to RLE format.