code: func (h *BytesRefHash) compact() []int {
  	assert2(h.bytesStart != nil, "bytesStart is nil - not initialized")
  	upto := 0
  	for i := 0; i < h.hashSize; i++ {
  		if h.ids[i] != -1 {
  			if upto < i {
  				h.ids[upto] = h.ids[i]
  				h.ids[i] = -1
  			}
  			upto++
  		}
  	}
  
  	assert(upto == h.count)
  	h.lastCount = h.count
  	return h.ids
  }
docs: /*
  Returns the ids array in arbitrary order. Valid ids start at offset
  of 0 and end at a limit of size() - 1
  
  Note: This is a destructive operation. clear() must be called in
  order to reuse this BytesRefHash instance.
  */