StringSortedFromSlice creates a StringSorted from a slice.
(s []string)
| 273 | |
| 274 | // StringSortedFromSlice creates a StringSorted from a slice. |
| 275 | func StringSortedFromSlice(s []string) StringSorted { |
| 276 | if s == nil { |
| 277 | return nil |
| 278 | } |
| 279 | dst := make(StringSorted, len(s)) |
| 280 | for _, v := range s { |
| 281 | dst[v] = struct{}{} |
| 282 | } |
| 283 | return dst |
| 284 | } |
| 285 | |
| 286 | // Int is a set of ints that will be stored as an array. |
| 287 | // Elements are not sorted and the order of elements is not guaranteed. |
no outgoing calls
searching dependent graphs…