(v ...T)
| 17 | type Set[T comparable] map[T]struct{} |
| 18 | |
| 19 | func NewSet[T comparable](v ...T) Set[T] { |
| 20 | if len(v) == 0 { |
| 21 | return make(Set[T]) |
| 22 | } |
| 23 | |
| 24 | out := make(Set[T], len(v)) |
| 25 | for i := range v { |
| 26 | out.Add(v[i]) |
| 27 | } |
| 28 | return out |
| 29 | } |
| 30 | |
| 31 | func (s Set[T]) Has(v T) bool { |
| 32 | _, ok := s[v] |
no test coverage detected