diff --git a/util/set/set.go b/util/set/set.go index c6db4f3f2..1458e64d4 100644 --- a/util/set/set.go +++ b/util/set/set.go @@ -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 }