Skip to content

Commit 2db175d

Browse files
committed
fix: fix value behavior
1 parent 6327f97 commit 2db175d

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

iter.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@ import (
66
"iter"
77
)
88

9-
// Values iterator over sequences of individual values.
10-
//
11-
// Deprecated: use All instead.
12-
func (s Set[T]) Values() iter.Seq[T] { return s.All() }
13-
149
// All iterator over sequences of individual values.
1510
func (s Set[T]) All() iter.Seq[T] {
1611
return func(yield func(T) bool) {

set.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,15 +124,22 @@ func (s Set[T]) Clone() Set[T] {
124124
return NewFrom(s)
125125
}
126126

127-
// List returns the contents as a sorted slice.
128-
func (s Set[T]) List() []T {
127+
// Values returns the value of the sets.
128+
func (s Set[T]) Values() []T {
129129
res := make([]T, 0, len(s))
130130
for key := range s {
131131
res = append(res, key)
132132
}
133133
return res
134134
}
135135

136+
// List returns the value of the sets.
137+
//
138+
// Deprecated: use Values instead.
139+
func (s Set[T]) List() []T {
140+
return s.Values()
141+
}
142+
136143
// Each traverses the items in the Set, calling the provided function for each
137144
// set member. Traversal will continue until all items in the Set have been
138145
// visited, or if the closure returns false.

0 commit comments

Comments
 (0)