IntersectionWithLower returns the intersection of two sets with different case of string.
(rhs StringSet, toLower bool)
| 56 | |
| 57 | // IntersectionWithLower returns the intersection of two sets with different case of string. |
| 58 | func (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. |
| 75 | func (s StringSet) Count() int { |
nothing calls this directly
no test coverage detected