MCPcopy Create free account
hub / github.com/exercism/cli / removeDuplicatePaths

Method removeDuplicatePaths

cmd/submit.go:176–188  ·  view source on GitHub ↗
(submitPaths []string)

Source from the content-addressed store, hash-verified

174}
175
176func (s *submitCmdContext) removeDuplicatePaths(submitPaths []string) []string {
177 seen := make(map[string]bool)
178 result := make([]string, 0, len(submitPaths))
179
180 for _, val := range submitPaths {
181 if _, ok := seen[val]; !ok {
182 seen[val] = true
183 result = append(result, val)
184 }
185 }
186
187 return result
188}
189
190// exercise creates an exercise using one of the submitted filepaths.
191// This assumes prior verification that submit paths belong to the same exercise.

Callers 1

runSubmitFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected