MCPcopy Create free account
hub / github.com/OpenAtomFoundation/SmartIDE / removeDups

Function removeDups

cli/pkg/ssh_config/config.go:663–676  ·  view source on GitHub ↗
(arr []string)

Source from the content-addressed store, hash-verified

661var ErrDepthExceeded = errors.New("ssh_config: max recurse depth exceeded")
662
663func removeDups(arr []string) []string {
664 // Use map to record duplicates as we find them.
665 encountered := make(map[string]bool, len(arr))
666 result := make([]string, 0)
667
668 for v := range arr {
669 //lint:ignore S1002 I prefer it this way
670 if encountered[arr[v]] == false {
671 encountered[arr[v]] = true
672 result = append(result, arr[v])
673 }
674 }
675 return result
676}
677
678// NewInclude creates a new Include with a list of file globs to include.
679// Configuration files are parsed greedily (e.g. as soon as this function runs).

Callers 1

NewIncludeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected