MCPcopy
hub / github.com/git-lfs/git-lfs / Difference

Method Difference

tools/ordered_set.go:134–143  ·  view source on GitHub ↗

Difference returns the elements that are in this set, but not included in other.

(other *OrderedSet)

Source from the content-addressed store, hash-verified

132// Difference returns the elements that are in this set, but not included in
133// other.
134func (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.
146func (s *OrderedSet) SymmetricDifference(other *OrderedSet) *OrderedSet {

Callers 1

SymmetricDifferenceMethod · 0.95

Calls 4

CardinalityMethod · 0.95
ContainsMethod · 0.65
AddMethod · 0.65

Tested by

no test coverage detected