code: func mergepgids(dst, a, b pgids) {
  	if len(dst) < len(a)+len(b) {
  		panic(fmt.Errorf("mergepgids bad len %d < %d + %d", len(dst), len(a), len(b)))
  	}
  	// Copy in the opposite slice if one is nil.
  	if len(a) == 0 {
  		copy(dst, b)
  		return
  	}
  	if len(b) == 0 {
  		copy(dst, a)
  		return
  	}
  
  	// Merged will hold all elements from both lists.
  	merged := dst[:0]
  
  	// Assign lead to the slice with a lower starting value, follow to the higher value.
  	lead, follow := a, b
  	if b[0] < a[0] {
  		lead, follow = b, a
  	}
  
  	// Continue while there are elements in the lead.
  	for len(lead) > 0 {
  		// Merge largest prefix of lead that is ahead of follow[0].
  		n := sort.Search(len(lead), func(i int) bool { return lead[i] > follow[0] })
  		merged = append(merged, lead[:n]...)
  		if n >= len(lead) {
  			break
  		}
  
  		// Swap lead and follow.
  		lead, follow = follow, lead[n:]
  	}
  
  	// Append what's left in follow.
  	_ = append(merged, follow...)
  }
docs: // mergepgids copies the sorted union of a and b into dst.
  // If dst is too small, it panics.