Use clear for clearing maps (#1923)

This commit is contained in:
Joe Lim authored and GitHub committed 2025-02-23 19:56:50 +11:00
1 parent 938e02e126
commit 0e66d02746
3 files changed
+14 -14

No files matched your search

+2 -2
View File
@@ -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
}