code: func toCompressed(cn *cNode, lev uint) *mainNode {
  	tmpArray := make([]branch, len(cn.array))
  	for i, sub := range cn.array {
  		switch sub.(type) {
  		case *iNode:
  			inode := sub.(*iNode)
  			mainPtr := (*unsafe.Pointer)(unsafe.Pointer(&inode.main))
  			main := (*mainNode)(atomic.LoadPointer(mainPtr))
  			tmpArray[i] = resurrect(inode, main)
  		case *sNode:
  			tmpArray[i] = sub
  		default:
  			panic("Ctrie is in an invalid state")
  		}
  	}
  
  	return toContracted(&cNode{bmp: cn.bmp, array: tmpArray}, lev)
  }
docs: // toCompressed compacts the C-node as a performance optimization.