Function assumes that fileMap is locked for access TODO: This function is very expensive O(n), is there a better solution?
(dirpath string)
| 51 | // Function assumes that fileMap is locked for access |
| 52 | // TODO: This function is very expensive O(n), is there a better solution? |
| 53 | func (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 | } |
no outgoing calls