From 30bcac2aaa1b2c221e59f739e96b60999ae3865d Mon Sep 17 00:00:00 2001 From: tidwall Date: Tue, 22 Mar 2022 10:58:06 -0700 Subject: [PATCH] Rename variable --- redcon.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/redcon.go b/redcon.go index 133f0c3..6bbd665 100644 --- a/redcon.go +++ b/redcon.go @@ -1295,8 +1295,8 @@ func (ps *PubSub) subscribe(conn Conn, pattern bool, channel string) { } sconn.dconn.WriteBulkString(channel) var count int - for ient := range sconn.entries { - if ient.pattern == pattern { + for entry := range sconn.entries { + if entry.pattern == pattern { count++ } } @@ -1334,8 +1334,8 @@ func (ps *PubSub) unsubscribe(conn Conn, pattern, all bool, channel string) { sconn.dconn.WriteNull() } var count int - for ient := range sconn.entries { - if ient.pattern == pattern { + for entry := range sconn.entries { + if entry.pattern == pattern { count++ } } @@ -1344,9 +1344,9 @@ func (ps *PubSub) unsubscribe(conn Conn, pattern, all bool, channel string) { if all { // unsubscribe from all (p)subscribe entries var entries []*pubSubEntry - for ient := range sconn.entries { - if ient.pattern == pattern { - entries = append(entries, ient) + for entry := range sconn.entries { + if entry.pattern == pattern { + entries = append(entries, entry) } } if len(entries) == 0 { @@ -1358,9 +1358,9 @@ func (ps *PubSub) unsubscribe(conn Conn, pattern, all bool, channel string) { } } else { // unsubscribe single channel from (p)subscribe. - for ient := range sconn.entries { - if ient.pattern == pattern && ient.channel == channel { - removeEntry(ient) + for entry := range sconn.entries { + if entry.pattern == pattern && entry.channel == channel { + removeEntry(entry) break } }