// Sorted return packages in slice form and sorted by package directory
506497
func (t *PackageList) Sorted() []*build.Package {
	t.ensureInit()

	keys := make([]string, len(t.dirpool))
	i := 0
	for k := range t.dirpool {
		keys[i] = k
		i++
	}
	sort.Strings(keys)

	result := make([]*build.Package, len(t.dirpool))
	i = 0
	for _, k := range keys {
		result[i] = t.dirpool[k]
		i++
	}

	return result
}
641695
func (ms *multiAddrSorter) Sort(sockAddrs SockAddrs) {
	ms.addrs = sockAddrs
	sort.Sort(ms)
}
602151
func (ms *multiSorter) Sort(stats []ExprStats) {
	ms.stats = stats
	sort.Sort(ms)
}
530328
func (s *CatCountService) Sort(fields ...string) *CatCountService {
	s.sort = fields
	return s
}
1202036
func (s *SearchService) Sort(field string, ascending bool) *SearchService {
	s.searchSource = s.searchSource.Sort(field, ascending)
	return s
}
150674
func (arr Array) Sorted() Array {
	cpy := make(Array, len(arr))
	for i := range cpy {
		cpy[i] = arr[i]
	}
	sort.Sort(termSlice(cpy))
	return cpy
}
1114213
func (f *Feed) Sort(less func(a, b *Item) bool) {
	lessFunc := func(i, j int) bool {
		return less(f.Items[i], f.Items[j])
	}
	sort.SliceStable(f.Items, lessFunc)
}
894056
func (ms *multiSorter) Sort(pods []*v1.Pod) {
	ms.pods = pods
	sort.Sort(ms)
}
718774
func (ls LabelArray) Sort() LabelArray {
	sort.Slice(ls, func(i, j int) bool {
		return ls[i].Key < ls[j].Key
	})
	return ls
}
58662
func (s *DeleteByQueryService) Sort(sort ...string) *DeleteByQueryService {
	s.sort = append(s.sort, sort...)
	return s
}
1328566
func (s *CatIndicesService) Sort(fields ...string) *CatIndicesService {
	s.sort = fields
	return s
}
1260057
func (s *UpdateByQueryService) Sort(sort ...string) *UpdateByQueryService {
	s.sort = append(s.sort, sort...)
	return s
}
1351456
func (s Sortable) Less(i, j int) bool {
	return len(s[i].Pointers) > len(s[j].Pointers)

}
517969
func (m Map) SortedString() string {
	buf := bufPool.Get()
	defer bufPool.Put(buf)
	m.sortedWriteBuf(buf)
	return buf.String()
}
1299966
func (s *SearchSource) Sort(field string, ascending bool) *SearchSource {
	s.sorters = append(s.sorters, SortInfo{Field: field, Ascending: ascending})
	return s
}
764406
func (k *keyset) Sorted() []*libkb.PGPKeyBundle {
	var sorted []*libkb.PGPKeyBundle
	for _, kid := range k.index {
		sorted = append(sorted, k.keys[kid])
	}
	return sorted
}
146806
func (g *Graph) Sort() (sorted []util.T, ok bool) {
	if g.sorted != nil {
		return g.sorted, true
	}

	sort := &graphSort{
		sorted: make([]util.T, 0, len(g.nodes)),
		deps:   g.Dependencies,
		marked: map[util.T]struct{}{},
		temp:   map[util.T]struct{}{},
	}

	for node := range g.nodes {
		if !sort.Visit(node) {
			return nil, false
		}
	}

	g.sorted = sort.sorted
	return g.sorted, true
}