(vms []*api.VM)
| 239 | } |
| 240 | |
| 241 | func uniqueSortedVMNodes(vms []*api.VM) []string { |
| 242 | set := map[string]struct{}{} |
| 243 | for _, vm := range vms { |
| 244 | if vm == nil { |
| 245 | continue |
| 246 | } |
| 247 | node := strings.TrimSpace(vm.Node) |
| 248 | if node == "" { |
| 249 | continue |
| 250 | } |
| 251 | set[node] = struct{}{} |
| 252 | } |
| 253 | |
| 254 | out := make([]string, 0, len(set)) |
| 255 | for node := range set { |
| 256 | out = append(out, node) |
| 257 | } |
| 258 | sort.Strings(out) |
| 259 | |
| 260 | return out |
| 261 | } |
| 262 | |
| 263 | func indexOfOption(options []string, target string) int { |
| 264 | for i, option := range options { |
no outgoing calls
no test coverage detected