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 <[email protected]>
  • Loading branch information
danielkleinstein committed Oct 28, 2024
1 parent e6ec8d3 commit d1bb887
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
9 changes: 2 additions & 7 deletions api/config/v1/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,8 @@ 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")
}
// Disable renaming / device selection in Sharing.MPS.Resources
if (config.Sharing.MPS != nil) {
config.Sharing.MPS.disableResoureRenaming(logger, "mps")
}
config.Sharing.TimeSlicing.disableResoureRenaming(logger, "timeSlicing")
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 d1bb887

Please sign in to comment.