Difference returns the elements that are in this set, but not included in other.
(other *OrderedSet)
| 132 | // Difference returns the elements that are in this set, but not included in |
| 133 | // other. |
| 134 | func (s *OrderedSet) Difference(other *OrderedSet) *OrderedSet { |
| 135 | diff := NewOrderedSetWithCapacity(s.Cardinality()) |
| 136 | for _, e := range s.s { |
| 137 | if !other.Contains(e) { |
| 138 | diff.Add(e) |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | return diff |
| 143 | } |
| 144 | |
| 145 | // SymmetricDifference returns the elements that are not present in both sets. |
| 146 | func (s *OrderedSet) SymmetricDifference(other *OrderedSet) *OrderedSet { |
no test coverage detected