// See sort.Interface.
761553
func (n *serviceNodeSorter) Less(i, j int) bool {
	return n.Vec[i] < n.Vec[j]
}
803101
func (comp *orderedOrdering) Sort(dimensions map[string]string) []string {
	dims := make([]string, 0, len(dimensions))
	for k := range dimensions {
		dims = append(dims, k)
	}
	req := &orderedDimensionSortRequest{
		comparor:     comp,
		dimensions:   dimensions,
		currentOrder: dims,
	}
	sort.Sort(req)
	return req.currentOrder
}
1299966
func (s *SearchSource) Sort(field string, ascending bool) *SearchSource {
	s.sorters = append(s.sorters, SortInfo{Field: field, Ascending: ascending})
	return s
}
364068
func Sort(list cty.Value) (cty.Value, error) {
	return SortFunc.Call([]cty.Value{list})
}
45960
func (v ProviderVersionCollection) Sort() {
	sort.Slice(v, func(i, j int) bool {
		versionA, _ := version.NewVersion(v[i].Version)
		versionB, _ := version.NewVersion(v[j].Version)

		return versionA.GreaterThan(versionB)
	})
}
1136330
func Less(orders []Order, a, b Entry) bool {
	for _, cmp := range orders {
		switch cmp.Compare(a, b) {
		case 0:
		case -1:
			return true
		case 1:
			return false
		}
	}

	// This gives us a *stable* sort for free. We don't care
	// preserving the order from the underlying datastore
	// because it's undefined.
	return a.Key < b.Key
}
1286343
func (f *frame) Sort(header string, st SortType, so SortOption) error {
	f.mu.Lock()
	idx, ok := f.headerTo[header]
	if !ok {
		f.mu.Unlock()
		return fmt.Errorf("%q does not exist", header)
	}
	f.mu.Unlock()

	var lesses []LessFunc
	switch st {
	case SortType_String:
		switch so {
		case SortOption_Ascending:
			lesses = []LessFunc{StringAscendingFunc(idx)}

		case SortOption_Descending:
			lesses = []LessFunc{StringDescendingFunc(idx)}
		}

	case SortType_Float64:
		switch so {
		case SortOption_Ascending:
			lesses = []LessFunc{Float64AscendingFunc(idx)}

		case SortOption_Descending:
			lesses = []LessFunc{Float64DescendingFunc(idx)}
		}

	case SortType_Duration:
		switch so {
		case SortOption_Ascending:
			lesses = []LessFunc{DurationAscendingFunc(idx)}

		case SortOption_Descending:
			lesses = []LessFunc{DurationDescendingFunc(idx)}
		}
	}

	headers, rows := f.Rows()
	SortBy(
		rows,
		lesses...,
	).Sort(rows)

	nf, err := NewFromRows(headers, rows)
	if err != nil {
		return err
	}
	v, ok := nf.(*frame)
	if !ok {
		return fmt.Errorf("cannot type assert on frame")
	}
	// *f = *v
	f.columns = v.columns
	f.headerTo = v.headerTo
	return nil
}
1115606
func (r *SearchRequest) SortBy(sorter ...Sorter) *SearchRequest {
	r.searchSource = r.searchSource.SortBy(sorter...)
	return r
}
1328566
func (s *CatIndicesService) Sort(fields ...string) *CatIndicesService {
	s.sort = fields
	return s
}
1351456
func (s Sortable) Less(i, j int) bool {
	return len(s[i].Pointers) > len(s[j].Pointers)

}
473736
func Sort(data interface{}, identifier ...func(interface{}) int) {
	val := reflect.ValueOf(data)
	identifier = append(identifier, DefaultID)
	sortable := byInt{
		Data:       val,
		Indices:    make([]int, val.Len()),
		Identifier: identifier[0],
	}
	for i := 0; i < val.Len(); i++ {
		sortable.Indices[i] = i
	}
	sort.Sort(sortable)
	return
}
192920
func (array orderTabletsForSwap) Less(i, j int) bool {
	return tabletSortIndex(&array[i]) < tabletSortIndex(&array[j])
}
150217
func (l sortEntries) Sort() {
	x := len(l)
	if x > 16 {
		sort.Sort(l)
	} else if len(l) > 1 {
		l.qSort()
	}
}
1218453
func Sorting(field sortingField, order sortingOrder) QueryOpt {
	return QueryOpt{func(o *QueryOptions) {
		o.SortField = field
		o.SortOrder = order
	}}
}
438203
func (s int64Sorter) Less(i, j int) bool {
	return s[i] < s[j]
}
423785
func (c ControllerList) Sort() {
	sort.Slice(c, func(i, j int) bool { return c[i].Name < c[j].Name })
}
999365
func (self *Query) Sort(fields ...string) *Query {

	self.sort = append(self.sort, fields...)

	return self
}