MCPcopy Index your code
hub / github.com/devspace-sh/devspace / RemoveDirInFileMap

Method RemoveDirInFileMap

pkg/devspace/sync/file_index.go:53–65  ·  view source on GitHub ↗

Function assumes that fileMap is locked for access TODO: This function is very expensive O(n), is there a better solution?

(dirpath string)

Source from the content-addressed store, hash-verified

51// Function assumes that fileMap is locked for access
52// TODO: This function is very expensive O(n), is there a better solution?
53func (f *fileIndex) RemoveDirInFileMap(dirpath string) {
54 if f.fileMap[dirpath] != nil {
55 delete(f.fileMap, dirpath)
56
57 dirpath = dirpath + "/"
58
59 for key := range f.fileMap {
60 if strings.Index(key, dirpath) == 0 {
61 delete(f.fileMap, key)
62 }
63 }
64 }
65}

Callers 2

applyRemovesMethod · 0.80
TestRemoveDirInFileMapFunction · 0.80

Calls

no outgoing calls

Tested by 1

TestRemoveDirInFileMapFunction · 0.64