// Sorted returns the unique keys in insertion order.
764406
func (k *keyset) Sorted() []*libkb.PGPKeyBundle {
	var sorted []*libkb.PGPKeyBundle
	for _, kid := range k.index {
		sorted = append(sorted, k.keys[kid])
	}
	return sorted
}
869263
func (m *SortedMap) Keys() []string {
	keys := make([]string, 0, m.Size())
	m.trie.Allprefixed([]byte{}, func(k []byte, v interface{}) bool {
		keys = append(keys, string(k))
		return true
	})
	return keys
}
1218453
func Sorting(field sortingField, order sortingOrder) QueryOpt {
	return QueryOpt{func(o *QueryOptions) {
		o.SortField = field
		o.SortOrder = order
	}}
}
1359104
func (m *SpiderMenu) Sort(col int, order walk.SortOrder) error {
	m.sortColumn, m.sortOrder = col, order

	sort.Sort(m)

	return m.SorterBase.Sort(col, order)
}
1053643
func Sort(g Iterator) *Immutable {
	if g, ok := g.(*Immutable); ok {
		return g
	}
	return build(g, false)
}
847352
func (a *BucketSortAggregation) Sort(field string, ascending bool) *BucketSortAggregation {
	a.sorters = append(a.sorters, SortInfo{Field: field, Ascending: ascending})
	return a
}
602151
func (ms *multiSorter) Sort(stats []ExprStats) {
	ms.stats = stats
	sort.Sort(ms)
}
1206770
func (neq Neq) sortedKeys() []string {
	keys := make([]string, 0, len(neq))
	for key := range neq {
		keys = append(keys, key)
	}
	sort.Strings(keys)
	return keys
}
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
}
1283420
func (v VarBinds) Sort() VarBinds {
	c := make(VarBinds, len(v))
	copy(c, v)
	sort.Sort(sortableVarBinds{c})
	return c
}
1005338
func (d *Dataset) Sort(name string, sortOption *SortOption) *Dataset {
	ret := d.LocalSort(name, sortOption)
	ret = ret.TreeMergeSortedTo(name, 1, 10)
	return ret
}
1211754
func (ms *multiIfAddrSorter) Sort(ifAddrs IfAddrs) {
	ms.ifAddrs = ifAddrs
	sort.Sort(ms)
}
253914
func (s *FieldSort) Order(ascending bool) *FieldSort {
	s.ascending = ascending
	return s
}
776374
func sort(s1, s2 string) (shorter, longer string) {
	if utf8.RuneCountInString(s1) < utf8.RuneCountInString(s2) {
		return s1, s2
	}
	return s2, s1
}
1140895
func (r *ring) keys(sorted bool) [][]byte {
	keys := make([][]byte, 0, atomic.LoadInt64(&r.keysHint))
	for _, p := range r.partitions {
		keys = append(keys, p.keys()...)
	}

	if sorted {
		bytesutil.Sort(keys)
	}
	return keys
}
907082
func (l Labels) SortedList() []byte {
	var keys []string
	for k := range l {
		keys = append(keys, k)
	}
	sort.Strings(keys)

	result := ""
	for _, k := range keys {
		result += l[k].FormatForKVStore()
	}

	return []byte(result)
}
530328
func (s *CatCountService) Sort(fields ...string) *CatCountService {
	s.sort = fields
	return s
}