mirror of
https://github.com/tailscale/tailscale.git
synced 2026-11-24 10:41:19 -08:00
util/set: provide a size hint when calling Set.Of
We already do this for `Set.OfSliceView`. Updates #cleanup Change-Id: I6ce3022ddabae2a0891e76ca45f3a7c601627a02 Signed-off-by: Alex Chan <[email protected]>
This commit is contained in:
1 parent
2ddef398f9
commit
dd50731b7b
1 file changed
+1
-1
+1
-1
@@ -24,7 +24,7 @@ func SetOf[T comparable](slice []T) Set[T] {
|
||||
|
||||
// Of returns a new set constructed from the elements in slice.
|
||||
func Of[T comparable](slice ...T) Set[T] {
|
||||
s := make(Set[T])
|
||||
s := make(Set[T], len(slice))
|
||||
s.AddSlice(slice)
|
||||
return s
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user