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

Function HasDuplicateStr

pkg/lib/slices/string.go:116–125  ·  view source on GitHub ↗
(in []string)

Source from the content-addressed store, hash-verified

114}
115
116func HasDuplicateStr(in []string) bool {
117 keys := strset.New()
118 for _, elem := range in {
119 if keys.Has(elem) {
120 return true
121 }
122 keys.Add(elem)
123 }
124 return false
125}
126
127func FindDuplicateStrs(in []string) []string {
128 dups := []string{}

Callers

nothing calls this directly

Calls 3

NewFunction · 0.92
HasMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected