MCPcopy Create free account
hub / github.com/cortexproject/cortex / sortUsingMap

Function sortUsingMap

pkg/util/strings_test.go:117–132  ·  view source on GitHub ↗
(resps ...[]string)

Source from the content-addressed store, hash-verified

115}
116
117func sortUsingMap(resps ...[]string) []string {
118 valueSet := map[string]struct{}{}
119 for _, resp := range resps {
120 for _, v := range resp {
121 valueSet[v] = struct{}{}
122 }
123 }
124
125 values := make([]string, 0, len(valueSet))
126 for v := range valueSet {
127 values = append(values, v)
128 }
129
130 sort.Strings(values)
131 return values
132}

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected