Skip to content

Commit 2131612

Browse files
committed
pkg/cvo/sync_worker: Flatten a nested 'if changed'
One less level of nesting makes for slightly easier reading. The nested 'if changed' landed when sync_worker.go was born in 961873d (sync: Do config syncing in the background, 2019-01-11, #82).
1 parent e318b86 commit 2131612

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

pkg/cvo/sync_worker.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -382,10 +382,8 @@ func (w *SyncWorker) calculateNext(work *SyncWork) bool {
382382
// the state Update() calculated (to allow us to start in reconciling)
383383
if work.Empty() {
384384
work.State = w.work.State
385-
} else {
386-
if changed {
387-
work.State = payload.UpdatingPayload
388-
}
385+
} else if changed {
386+
work.State = payload.UpdatingPayload
389387
}
390388
// always clear the completed variable if we are not reconciling
391389
if work.State != payload.ReconcilingPayload {

0 commit comments

Comments
 (0)