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

Method IntersectionWithLower

pkg/util/set/string_set.go:58–72  ·  view source on GitHub ↗

IntersectionWithLower returns the intersection of two sets with different case of string.

(rhs StringSet, toLower bool)

Source from the content-addressed store, hash-verified

56
57// IntersectionWithLower returns the intersection of two sets with different case of string.
58func (s StringSet) IntersectionWithLower(rhs StringSet, toLower bool) StringSet {
59 newSet := NewStringSet()
60 for origElt := range rhs {
61 var elt string
62 if toLower {
63 elt = strings.ToLower(origElt)
64 } else {
65 elt = strings.ToUpper(origElt)
66 }
67 if s.Exist(elt) {
68 newSet.Insert(origElt)
69 }
70 }
71 return newSet
72}
73
74// Count returns the number in Set s.
75func (s StringSet) Count() int {

Callers

nothing calls this directly

Calls 5

ExistMethod · 0.95
InsertMethod · 0.95
NewStringSetFunction · 0.85
ToLowerMethod · 0.65
ToUpperMethod · 0.65

Tested by

no test coverage detected