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:
Alex Chan authored and Alex Chan committed 2026-10-23 17:28:23 -04:00
1 parent 2ddef398f9
commit dd50731b7b
1 file changed
+1 -1
+1 -1
View File
@@ -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
}