Use clear for clearing maps (#1923)
This commit is contained in:
1 parent
938e02e126
commit
0e66d02746
3 files changed
+14
-14
No files matched your search
@@ -110,7 +110,7 @@ func (watch *watch) loop() {
|
||||
dir.sort()
|
||||
watch.dirChan <- dir
|
||||
}
|
||||
watch.loads = make(map[string]bool)
|
||||
clear(watch.loads)
|
||||
case <-watch.updateTimer.C:
|
||||
for path := range watch.updates {
|
||||
if _, err := os.Lstat(path); err != nil {
|
||||
@@ -118,7 +118,7 @@ func (watch *watch) loop() {
|
||||
}
|
||||
watch.fileChan <- newFile(path)
|
||||
}
|
||||
watch.updates = make(map[string]bool)
|
||||
clear(watch.updates)
|
||||
case <-watch.quit:
|
||||
return
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user