MCPcopy
hub / github.com/cortexlabs/cortex / IsSubset

Method IsSubset

pkg/lib/sets/strset/strset.go:162–174  ·  view source on GitHub ↗

IsSubset tests whether t is a subset of s.

(t Set)

Source from the content-addressed store, hash-verified

160
161// IsSubset tests whether t is a subset of s.
162func (s Set) IsSubset(t Set) bool {
163 if len(s) < len(t) {
164 return false
165 }
166
167 for item := range t {
168 if !s.Has(item) {
169 return false
170 }
171 }
172
173 return true
174}
175
176// IsSuperset tests whether t is a superset of s.
177func (s Set) IsSuperset(t Set) bool {

Callers 2

TestIsSubsetFunction · 0.45
IsSupersetMethod · 0.45

Calls 1

HasMethod · 0.95

Tested by 1

TestIsSubsetFunction · 0.36