MCPcopy Index your code
hub / github.com/cortexlabs/cortex / HasAnyStrings

Function HasAnyStrings

pkg/lib/slices/string.go:37–48  ·  view source on GitHub ↗

HasAnyStrings checks if a string slice contains any string from the query string slice

(queries []string, list []string)

Source from the content-addressed store, hash-verified

35
36// HasAnyStrings checks if a string slice contains any string from the query string slice
37func HasAnyStrings(queries []string, list []string) bool {
38 keys := strset.New()
39 for _, elem := range queries {
40 keys.Add(elem)
41 }
42 for _, elem := range list {
43 if keys.Has(elem) {
44 return true
45 }
46 }
47 return false
48}
49
50// HasAllStrings checks if a string slice contains all the strings from the query string slice
51func HasAllStrings(queries []string, list []string) bool {

Callers

nothing calls this directly

Calls 3

NewFunction · 0.92
AddMethod · 0.45
HasMethod · 0.45

Tested by

no test coverage detected