Skip to content

Commit

Permalink
rm slice to set
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Lepekhin committed Jul 29, 2019
1 parent 4a21105 commit 8c2b2a0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
8 changes: 0 additions & 8 deletions set/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,3 @@ func (s Set) Subtract(other Set) {
delete(s, k)
}
}

func (s Set) ToSlice() []E {
a := make([]E, 0, len(s))
for k := range s {
a = append(a, k)
}
return a
}
2 changes: 1 addition & 1 deletion set/set_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ func TestSet(t *testing.T) {
a := New().Add(1).Add(2).AddMany(2, 3, 4, 5)
b := New().AddMany(2, 3)
a.Subtract(b)
t.Logf("%v", a.Copy().ToSlice())
t.Logf("%v", a.Copy())
}

0 comments on commit 8c2b2a0

Please sign in to comment.