From 21316129edee9b1ab1b5ecd00978ff0e62977dd6 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 28 May 2020 01:00:38 -0700 Subject: [PATCH] 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 961873d66a (sync: Do config syncing in the background, 2019-01-11, #82). --- pkg/cvo/sync_worker.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pkg/cvo/sync_worker.go b/pkg/cvo/sync_worker.go index fe4c162830..116acb0164 100644 --- a/pkg/cvo/sync_worker.go +++ b/pkg/cvo/sync_worker.go @@ -382,10 +382,8 @@ func (w *SyncWorker) calculateNext(work *SyncWork) bool { // the state Update() calculated (to allow us to start in reconciling) if work.Empty() { work.State = w.work.State - } else { - if changed { - work.State = payload.UpdatingPayload - } + } else if changed { + work.State = payload.UpdatingPayload } // always clear the completed variable if we are not reconciling if work.State != payload.ReconcilingPayload {