cpuset: Make 'ToSlice*' methods look like 'set' methods
In 'set', conversions to slice are done also, but with different names: ToSliceNoSort() -> UnsortedList() ToSlice() -> List() Reimplement List() in terms of UnsortedList to save some duplication.
This commit is contained in:
@@ -86,7 +86,7 @@ func getCPUsPerNUMANode(nodeNum int) ([]int, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return cpus.ToSlice(), nil
|
||||
return cpus.List(), nil
|
||||
}
|
||||
|
||||
func getCPUToNUMANodeMapFromEnv(f *framework.Framework, pod *v1.Pod, cnt *v1.Container, environ map[string]string, numaNodes int) (map[int]int, error) {
|
||||
@@ -99,7 +99,7 @@ func getCPUToNUMANodeMapFromEnv(f *framework.Framework, pod *v1.Pod, cnt *v1.Con
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cpuIDs = cpus.ToSlice()
|
||||
cpuIDs = cpus.List()
|
||||
}
|
||||
}
|
||||
if len(cpuIDs) == 0 {
|
||||
@@ -115,7 +115,7 @@ func getCPUToNUMANodeMapFromEnv(f *framework.Framework, pod *v1.Pod, cnt *v1.Con
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cpusPerNUMA[numaNode] = cpus.ToSlice()
|
||||
cpusPerNUMA[numaNode] = cpus.List()
|
||||
}
|
||||
|
||||
// CPU IDs -> NUMA Node ID
|
||||
|
Reference in New Issue
Block a user