This commit is contained in:
Kovid Goyal
2023-09-12 15:34:09 +05:30
parent 5889311688
commit 2d7bbf60cc

View File

@@ -60,6 +60,9 @@ func (self *Set[T]) AsSlice() []T {
}
func (self *Set[T]) Intersect(other *Set[T]) (ans *Set[T]) {
if other == nil {
return NewSet[T]()
}
if self.Len() < other.Len() {
ans = NewSet[T](self.Len())
for x := range self.items {