From 40df4aad14cca76d0572b22b8c9d564a2bc5f695 Mon Sep 17 00:00:00 2001 From: Chris Howey Date: Sat, 1 Jun 2013 16:37:11 -0500 Subject: [PATCH] If statements on map results more idiomatic. --- fsnotify_bsd.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/fsnotify_bsd.go b/fsnotify_bsd.go index a30b1ab..bd4d9d8 100644 --- a/fsnotify_bsd.go +++ b/fsnotify_bsd.go @@ -385,9 +385,8 @@ func (w *Watcher) watchDirectoryFiles(dirPath string) error { // Inherit fsnFlags from parent directory w.fsnmut.Lock() - dirFsnFlags, dirFsnFound := w.fsnFlags[dirPath] - if dirFsnFound { - w.fsnFlags[filePath] = dirFsnFlags + if flags, found := w.fsnFlags[dirPath]; found { + w.fsnFlags[filePath] = flags } else { w.fsnFlags[filePath] = FSN_ALL } @@ -444,9 +443,8 @@ func (w *Watcher) sendDirectoryChangeEvents(dirPath string) { if !doesExist { // Inherit fsnFlags from parent directory w.fsnmut.Lock() - dirFsnFlags, dirFsnFound := w.fsnFlags[dirPath] - if dirFsnFound { - w.fsnFlags[filePath] = dirFsnFlags + if flags, found := w.fsnFlags[dirPath]; found { + w.fsnFlags[filePath] = flags } else { w.fsnFlags[filePath] = FSN_ALL } -- 2.50.1