From fdad66de74b9fd6c6de9f38842e1ce166281a73c Mon Sep 17 00:00:00 2001 From: Nathaniel Caza Date: Tue, 17 Dec 2024 11:00:07 -0600 Subject: [PATCH] refactor: remove unnecessary checks for empty shifts in user and shift trimming functions --- engine/cleanupmanager/scheddata.go | 8 -------- 1 file changed, 8 deletions(-) diff --git a/engine/cleanupmanager/scheddata.go b/engine/cleanupmanager/scheddata.go index df80059deb..c19ddfece5 100644 --- a/engine/cleanupmanager/scheddata.go +++ b/engine/cleanupmanager/scheddata.go @@ -99,10 +99,6 @@ func trimInvalidUsers(data *schedule.Data, validUsers []uuid.UUID) (changed bool } cleanShifts = append(cleanShifts, shift) } - if len(cleanShifts) == 0 { - changed = true - continue - } temp.Shifts = cleanShifts newTempSched = append(newTempSched, temp) } @@ -138,10 +134,6 @@ func trimExpiredShifts(data *schedule.Data, cutoff time.Time) (changed bool, use users = append(users, id) } - if len(cleanShifts) == 0 { - changed = true - continue - } sched.Shifts = cleanShifts newTempSched = append(newTempSched, sched) }