nothing to see here

set: introduce set intersection

Signed-off-by: oppiliappan <me@oppi.li>

authored by oppi.li and committed by Tangled ba5233f0 b1b9ce16

Changed files
+11
+11
set.go
··· 33 33 maps.Copy(result, other) 34 34 return result 35 35 } 36 + 37 + // Intersection returns a new set containing elements common to s and other. 38 + func (s Set[T]) Intersection(other Set[T]) Set[T] { 39 + result := New[T]() 40 + for k := range s { 41 + if _, ok := other[k]; ok { 42 + result.Add(k) 43 + } 44 + } 45 + return result 46 + }