Skip to content

Commit

Permalink
less pointers
Browse files Browse the repository at this point in the history
now constructors returns by value instead of by reference a newly constructed sets
  • Loading branch information
flrdv authored and deckarep committed Mar 5, 2023
1 parent bc8f6ad commit 7aad8e9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions set.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ func NewSet[T comparable](vals ...T) Set[T] {
for _, item := range vals {
s.Add(item)
}
return &s
return s
}

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

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

0 comments on commit 7aad8e9

Please sign in to comment.