code: func (r *RuntimeSorter) Sort() error {
  	// a list is only considered "sorted" if there are 0 or 1 items in it
  	// AND (if 1 item) the item is not a Table object
  	if len(r.objects) == 0 {
  		return nil
  	}
  	if len(r.objects) == 1 {
  		_, isTable := r.objects[0].(*metav1beta1.Table)
  		if !isTable {
  			return nil
  		}
  	}
  
  	includesTable := false
  	includesRuntimeObjs := false
  
  	for _, obj := range r.objects {
  		switch t := obj.(type) {
  		case *metav1beta1.Table:
  			includesTable = true
  
  			if sorter, err := NewTableSorter(t, r.field); err != nil {
  				return err
  			} else if err := sorter.Sort(); err != nil {
  				return err
  			}
  		default:
  			includesRuntimeObjs = true
  		}
  	}
  
  	// we use a NopPositioner when dealing with Table objects
  	// because the objects themselves are not swapped, but rather
  	// the rows in each object are swapped / sorted.
  	r.positioner = &NopPositioner{}
  
  	if includesRuntimeObjs && includesTable {
  		return fmt.Errorf("sorting is not supported on mixed Table and non-Table object lists")
  	}
  	if includesTable {
  		return nil
  	}
  
  	// if not dealing with a Table response from the server, assume
  	// all objects are runtime.Object as usual, and sort using old method.
  	var err error
  	if r.positioner, err = SortObjects(r.decoder, r.objects, r.field); err != nil {
  		return err
  	}
  	return nil
  }
docs: // Sort performs the sorting of runtime objects