From 75eb65bbbfab56417026812c5353fe2f91329ca5 Mon Sep 17 00:00:00 2001 From: Daniel Kleinstein Date: Mon, 28 Oct 2024 13:46:48 +0000 Subject: [PATCH] config: Remove unnecessary nil checks Signed-off-by: Daniel Kleinstein --- api/config/v1/config.go | 8 ++------ api/config/v1/sharing.go | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/api/config/v1/config.go b/api/config/v1/config.go index 0ab9531d1..0af2c8125 100644 --- a/api/config/v1/config.go +++ b/api/config/v1/config.go @@ -97,13 +97,9 @@ func DisableResourceNamingInConfig(logger logger, config *Config) { config.Resources.MIGs = nil // Disable renaming / device selection in Sharing.TimeSlicing.Resources - if (config.sharing.TimeSlicing != nil) { - config.Sharing.TimeSlicing.disableResoureRenaming(logger, "timeSlicing") - } + config.Sharing.TimeSlicing.disableResoureRenaming(logger, "timeSlicing") // Disable renaming / device selection in Sharing.MPS.Resources - if (config.Sharing.MPS != nil) { - config.Sharing.MPS.disableResoureRenaming(logger, "mps") - } + config.Sharing.MPS.disableResoureRenaming(logger, "mps") } // parseConfig parses a config file as either YAML of JSON and unmarshals it into a Config struct. diff --git a/api/config/v1/sharing.go b/api/config/v1/sharing.go index e084f67a3..ab7681124 100644 --- a/api/config/v1/sharing.go +++ b/api/config/v1/sharing.go @@ -38,7 +38,7 @@ func (s *Sharing) SharingStrategy() SharingStrategy { return SharingStrategyMPS } - if s.TimeSlicing != nil && s.TimeSlicing.isReplicated() { + if s.TimeSlicing.isReplicated() { return SharingStrategyTimeSlicing } return SharingStrategyNone