@@ -24,18 +24,18 @@ import (
2424// string arrays and internal sets, and conversion logic requires public types today.
2525type Empty struct {}
2626
27- // Set is a set of the same type elements, implemented via map[comparable ]struct{} for minimal memory consumption.
28- type Set [E Ordered ] map [E ]Empty
27+ // Set is a set of the same type elements, implemented via map[ordered ]struct{} for minimal memory consumption.
28+ type Set [E ordered ] map [E ]Empty
2929
3030// New creates a new set.
31- func New [E Ordered ](items ... E ) Set [E ] {
31+ func New [E ordered ](items ... E ) Set [E ] {
3232 ss := Set [E ]{}
3333 ss .Insert (items ... )
3434 return ss
3535}
3636
3737// KeySet creates a Set[E] from a keys of a map[E](? extends interface{}).
38- func KeySet [E Ordered , A any ](theMap map [E ]A ) Set [E ] {
38+ func KeySet [E ordered , A any ](theMap map [E ]A ) Set [E ] {
3939 ret := Set [E ]{}
4040 for key := range theMap {
4141 ret .Insert (key )
@@ -98,7 +98,7 @@ func (s Set[E]) Union(s2 Set[E]) Set[E] {
9898 return result
9999}
100100
101- // Len returns the size of the set.
101+ // Len returns the number of elements in the set.
102102func (s Set [E ]) Len () int {
103103 return len (s )
104104}
@@ -158,7 +158,7 @@ func (s Set[E]) Equal(s2 Set[E]) bool {
158158 return s .Len () == s .Len () && s .IsSuperset (s2 )
159159}
160160
161- type sortableSlice [E Ordered ] []E
161+ type sortableSlice [E ordered ] []E
162162
163163func (s sortableSlice [E ]) Len () int {
164164 return len (s )
0 commit comments