MCPcopy Create free account
hub / github.com/JordanCoin/codemap / dedupe

Function dedupe

scanner/types.go:181–191  ·  view source on GitHub ↗

dedupe removes duplicate strings from a slice

(items []string)

Source from the content-addressed store, hash-verified

179
180// dedupe removes duplicate strings from a slice
181func dedupe(items []string) []string {
182 seen := make(map[string]bool)
183 result := make([]string, 0, len(items))
184 for _, item := range items {
185 if !seen[item] {
186 seen[item] = true
187 result = append(result, item)
188 }
189 }
190 return result
191}

Callers 3

ReadExternalDepsFunction · 0.85
ScanDirectoryMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected