Skip to content

Commit

Permalink
Reduce nesting
Browse files Browse the repository at this point in the history
  • Loading branch information
RebeccaMahany committed Jul 17, 2024
1 parent b50678e commit 33088a2
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions ee/control/control.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,13 +367,14 @@ func (cs *ControlService) fetchAndUpdate(subsystem, hash string) error {
// knownSubsystem checks our registered consumers and subscribers to see if the given
// subsystem is one that has been registered with the control service.
func (cs *ControlService) knownSubsystem(subsystem string) bool {
if _, subsystemFromConsumer := cs.consumers[subsystem]; !subsystemFromConsumer {
if _, subsystemFromSubscriber := cs.subscribers[subsystem]; !subsystemFromSubscriber {
return false
}
if _, subsystemFromConsumer := cs.consumers[subsystem]; subsystemFromConsumer {
return true
}
if _, subsystemFromSubscriber := cs.subscribers[subsystem]; subsystemFromSubscriber {
return true
}

return true
return false
}

// Registers a consumer for ingesting subsystem updates
Expand Down

0 comments on commit 33088a2

Please sign in to comment.