Commit e686ecb6 authored by Connor Doyle's avatar Connor Doyle

Renamed CPUSet.AsSlice() => CPUSet.ToSlice()

parent 8f38abb3
......@@ -140,9 +140,9 @@ func (s CPUSet) Difference(s2 CPUSet) CPUSet {
return s.FilterNot(func(cpu int) bool { return s2.Contains(cpu) })
}
// AsSlice returns a slice of integers that contains all elements from
// ToSlice returns a slice of integers that contains all elements from
// this set.
func (s CPUSet) AsSlice() []int {
func (s CPUSet) ToSlice() []int {
result := []int{}
for cpu := range s {
result = append(result, cpu)
......@@ -160,7 +160,7 @@ func (s CPUSet) String() string {
return ""
}
elems := s.AsSlice()
elems := s.ToSlice()
sort.Ints(elems)
type rng struct {
......
......@@ -269,7 +269,7 @@ func TestCPUSetDifference(t *testing.T) {
}
}
func TestCPUSetAsSlice(t *testing.T) {
func TestCPUSetToSlice(t *testing.T) {
testCases := []struct {
set CPUSet
expected []int
......@@ -280,7 +280,7 @@ func TestCPUSetAsSlice(t *testing.T) {
}
for _, c := range testCases {
result := c.set.AsSlice()
result := c.set.ToSlice()
if !reflect.DeepEqual(result, c.expected) {
t.Fatalf("expected set as slice to be [%v] (got [%v]), s: [%v]", c.expected, result, c.set)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment