Skip to content

Commit eaf5922

Browse files
committed
inverse continue/return for clarity
1 parent 0b16448 commit eaf5922

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

agent/agentcontainers/watcher/watcher.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,11 @@ func (f *fsnotifyWatcher) Next(ctx context.Context) (event *fsnotify.Event, err
152152
f.mu.Lock()
153153
isWatched := f.watchedFiles[absPath]
154154
f.mu.Unlock()
155-
if isWatched {
156-
return &evt, nil
155+
if !isWatched {
156+
continue // Ignore events for files not being watched.
157157
}
158158

159-
continue // Ignore events for files not being watched.
159+
return &evt, nil
160160

161161
case err, ok := <-f.Errors:
162162
if !ok {

0 commit comments

Comments
 (0)