Skip to content

Commit d2cc0d0

Browse files
Merge pull request #374 from wking/flatten-if-changed
pkg/cvo/sync_worker: Flatten a nested 'if changed'
2 parents e43c031 + 2131612 commit d2cc0d0

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
@@ -384,10 +384,8 @@ func (w *SyncWorker) calculateNext(work *SyncWork) bool {
384384
// the state Update() calculated (to allow us to start in reconciling)
385385
if work.Empty() {
386386
work.State = w.work.State
387-
} else {
388-
if changed {
389-
work.State = payload.UpdatingPayload
390-
}
387+
} else if changed {
388+
work.State = payload.UpdatingPayload
391389
}
392390
// always clear the completed variable if we are not reconciling
393391
if work.State != payload.ReconcilingPayload {

0 commit comments

Comments
 (0)