From a553e8038e4e8a93c66d65604504b9ea7dda3458 Mon Sep 17 00:00:00 2001 From: Max Claus Nunes Date: Sun, 24 Jun 2018 20:48:34 -0300 Subject: [PATCH] Improve remove overlap to skip already checked paths --- watcher.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/watcher.go b/watcher.go index 89acf76..6890c54 100644 --- a/watcher.go +++ b/watcher.go @@ -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