code: func (p *MemPostings) EnsureOrder() {
  	p.mtx.Lock()
  	defer p.mtx.Unlock()
  
  	if p.ordered {
  		return
  	}
  
  	n := runtime.GOMAXPROCS(0)
  	workc := make(chan []uint64)
  
  	var wg sync.WaitGroup
  	wg.Add(n)
  
  	for i := 0; i < n; i++ {
  		go func() {
  			for l := range workc {
  				sort.Slice(l, func(i, j int) bool { return l[i] < l[j] })
  			}
  			wg.Done()
  		}()
  	}
  
  	for _, e := range p.m {
  		for _, l := range e {
  			workc <- l
  		}
  	}
  	close(workc)
  	wg.Wait()
  
  	p.ordered = true
  }
docs: // EnsureOrder ensures that all postings lists are sorted. After it returns all further
  // calls to add and addFor will insert new IDs in a sorted manner.