From 17d055eab2613eb164b4e15c3705031042802906 Mon Sep 17 00:00:00 2001 From: Nathan Hack Date: Fri, 19 Nov 2021 21:12:12 -0500 Subject: [PATCH] fixed unsubscribe bug --- redcon.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/redcon.go b/redcon.go index 80614ee..54a44f5 100644 --- a/redcon.go +++ b/redcon.go @@ -1389,14 +1389,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() }