Skip to content

Commit 7aad8e9

Browse files
flrdvdeckarep
authored andcommitted
less pointers
now constructors returns by value instead of by reference a newly constructed sets
1 parent bc8f6ad commit 7aad8e9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

set.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ func NewSet[T comparable](vals ...T) Set[T] {
182182
for _, item := range vals {
183183
s.Add(item)
184184
}
185-
return &s
185+
return s
186186
}
187187

188188
// NewThreadUnsafeSet creates and returns a new set with the given elements.
@@ -192,7 +192,7 @@ func NewThreadUnsafeSet[T comparable](vals ...T) Set[T] {
192192
for _, item := range vals {
193193
s.Add(item)
194194
}
195-
return &s
195+
return s
196196
}
197197

198198
// Creates and returns a new set with the given keys of the map.

0 commit comments

Comments
 (0)