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

Method Equal

tools/stringset.go:153–163  ·  view source on GitHub ↗

Equal determines if two sets are equal to each other. If they both are the same size and have the same items they are considered equal. Order of items is not relevant for sets to be equal.

(other StringSet)

Source from the content-addressed store, hash-verified

151// If they both are the same size and have the same items they are considered equal.
152// Order of items is not relevant for sets to be equal.
153func (set StringSet) Equal(other StringSet) bool {
154 if set.Cardinality() != other.Cardinality() {
155 return false
156 }
157 for elem := range set {
158 if !other.Contains(elem) {
159 return false
160 }
161 }
162 return true
163}
164
165// Returns a clone of the set.
166// Does NOT clone the underlying elements.

Callers 15

TestCopyWithCallbackFunction · 0.45
AssertMethod · 0.45
TestExpandPathFunction · 0.45
AssertMethod · 0.45
TestFastWalkBasicFunction · 0.45
TestCloneFileByPathFunction · 0.45
TestCloneFileFunction · 0.45

Calls 2

CardinalityMethod · 0.95
ContainsMethod · 0.65

Tested by 15

TestCopyWithCallbackFunction · 0.36
AssertMethod · 0.36
TestExpandPathFunction · 0.36
AssertMethod · 0.36
TestFastWalkBasicFunction · 0.36
TestCloneFileByPathFunction · 0.36
TestCloneFileFunction · 0.36