Skip to content

Commit

Permalink
Remove useless code
Browse files Browse the repository at this point in the history
  • Loading branch information
neekolas committed Aug 23, 2023
1 parent 104edb6 commit 47ac06e
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions pkg/api/message/v1/dispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func (d *dispatcher) Update(ch chan interface{}, topics ...string) {

// Lock the map so we can check if any existing subscriptions need to be removed
d.l.RLock()
topicsBySub, hasTopicsBySub := d.topicsBySub[ch]
topicsBySub := d.topicsBySub[ch]
toUnregister := make([]string, 0)
for topic := range topicsBySub {
if !newTopicMap[topic] {
Expand All @@ -102,12 +102,6 @@ func (d *dispatcher) Update(ch chan interface{}, topics ...string) {
}
d.l.RUnlock()

// If the user is not subscribed to anything, just register everything in the list
if !hasTopicsBySub {
d.Register(ch, topics...)
return
}

if len(toUnregister) > 0 {
d.Unregister(ch, toUnregister...)
}
Expand Down

0 comments on commit 47ac06e

Please sign in to comment.