From 0f365a560279adc5e9f0b34a61724afbe8409e71 Mon Sep 17 00:00:00 2001 From: shankai Date: Thu, 15 Jul 2021 18:44:48 +0800 Subject: [PATCH] Fix: unsubscribe single channel from (p)subscribe. --- redcon.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/redcon.go b/redcon.go index 46b7d65..c393f4a 100644 --- a/redcon.go +++ b/redcon.go @@ -1358,14 +1358,12 @@ func (ps *PubSub) unsubscribe(conn Conn, pattern, all bool, channel string) { } } else { // unsubscribe single channel from (p)subscribe. - var entry *pubSubEntry for ient := range sconn.entries { if ient.pattern == pattern && ient.channel == channel { - removeEntry(entry) + removeEntry(ient) break } } - removeEntry(entry) } sconn.dconn.Flush() }