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() }