forked from mirror/redcon
Rename variable
This commit is contained in:
parent
12fd027cec
commit
30bcac2aaa
20
redcon.go
20
redcon.go
|
@ -1295,8 +1295,8 @@ func (ps *PubSub) subscribe(conn Conn, pattern bool, channel string) {
|
||||||
}
|
}
|
||||||
sconn.dconn.WriteBulkString(channel)
|
sconn.dconn.WriteBulkString(channel)
|
||||||
var count int
|
var count int
|
||||||
for ient := range sconn.entries {
|
for entry := range sconn.entries {
|
||||||
if ient.pattern == pattern {
|
if entry.pattern == pattern {
|
||||||
count++
|
count++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1334,8 +1334,8 @@ func (ps *PubSub) unsubscribe(conn Conn, pattern, all bool, channel string) {
|
||||||
sconn.dconn.WriteNull()
|
sconn.dconn.WriteNull()
|
||||||
}
|
}
|
||||||
var count int
|
var count int
|
||||||
for ient := range sconn.entries {
|
for entry := range sconn.entries {
|
||||||
if ient.pattern == pattern {
|
if entry.pattern == pattern {
|
||||||
count++
|
count++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1344,9 +1344,9 @@ func (ps *PubSub) unsubscribe(conn Conn, pattern, all bool, channel string) {
|
||||||
if all {
|
if all {
|
||||||
// unsubscribe from all (p)subscribe entries
|
// unsubscribe from all (p)subscribe entries
|
||||||
var entries []*pubSubEntry
|
var entries []*pubSubEntry
|
||||||
for ient := range sconn.entries {
|
for entry := range sconn.entries {
|
||||||
if ient.pattern == pattern {
|
if entry.pattern == pattern {
|
||||||
entries = append(entries, ient)
|
entries = append(entries, entry)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if len(entries) == 0 {
|
if len(entries) == 0 {
|
||||||
|
@ -1358,9 +1358,9 @@ func (ps *PubSub) unsubscribe(conn Conn, pattern, all bool, channel string) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// unsubscribe single channel from (p)subscribe.
|
// unsubscribe single channel from (p)subscribe.
|
||||||
for ient := range sconn.entries {
|
for entry := range sconn.entries {
|
||||||
if ient.pattern == pattern && ient.channel == channel {
|
if entry.pattern == pattern && entry.channel == channel {
|
||||||
removeEntry(ient)
|
removeEntry(entry)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue