From 47ac06ed5ea901d03b04aaebb382d87c55571dd4 Mon Sep 17 00:00:00 2001 From: Nicholas Molnar Date: Wed, 23 Aug 2023 11:38:46 -0700 Subject: [PATCH] Remove useless code --- pkg/api/message/v1/dispatcher.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/pkg/api/message/v1/dispatcher.go b/pkg/api/message/v1/dispatcher.go index b1e2fe7e..e5e9b9a5 100644 --- a/pkg/api/message/v1/dispatcher.go +++ b/pkg/api/message/v1/dispatcher.go @@ -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] { @@ -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...) }