MCPcopy
hub / github.com/pingcap/tidb / Intersection

Method Intersection

pkg/util/set/string_set.go:47–55  ·  view source on GitHub ↗

Intersection returns the intersection of two sets

(rhs StringSet)

Source from the content-addressed store, hash-verified

45
46// Intersection returns the intersection of two sets
47func (s StringSet) Intersection(rhs StringSet) StringSet {
48 newSet := NewStringSet()
49 for elt := range s {
50 if rhs.Exist(elt) {
51 newSet.Insert(elt)
52 }
53 }
54 return newSet
55}
56
57// IntersectionWithLower returns the intersection of two sets with different case of string.
58func (s StringSet) IntersectionWithLower(rhs StringSet, toLower bool) StringSet {

Callers 5

TestStringSetFunction · 0.95
mergeMethod · 0.45
MakeOuterJoinMethod · 0.45
MaxOneRowMethod · 0.45
ProjectColsMethod · 0.45

Calls 3

InsertMethod · 0.95
NewStringSetFunction · 0.85
ExistMethod · 0.65

Tested by 1

TestStringSetFunction · 0.76