Skip to content

Commit

Permalink
config: Remove unnecessary nil checks
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Kleinstein <daniel.kleinstein@gmail.com>
  • Loading branch information
danielkleinstein committed Oct 28, 2024
1 parent c8ba53b commit 75eb65b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 2 additions & 6 deletions api/config/v1/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion api/config/v1/sharing.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 75eb65b

Please sign in to comment.