Improve remove overlap to skip already checked paths

This commit is contained in:
Max Claus Nunes 2018-06-24 20:48:34 -03:00
parent 89c15bf15c
commit a553e8038e
1 changed files with 5 additions and 0 deletions

View File

@ -150,6 +150,11 @@ func resolvePaths(paths []string, extensions map[string]bool) (map[string]bool,
// remove overlapped paths so it makes the scan for changes later faster and simpler
func removeOverlappedPaths(mapPaths map[string]bool) {
for p1 := range mapPaths {
// skip to next item if this path has already been checked
if v, ok := mapPaths[p1]; ok && !v {
continue
}
for p2 := range mapPaths {
if p1 == p2 {
continue