op: low performance code (#102)

thanks
This commit is contained in:
蹬 authored and GitHub committed 2021-01-07 14:12:28 +08:00
1 parent 6be79cbe88
commit c2248bed2b
1 file changed
+17 -9
+17 -9
View File
@@ -256,16 +256,24 @@ func (this *snode) smatch(topic []byte, qos byte, subs *[]interface{}, qoss *[]b
return err return err
} }
level := string(ntl) // If the key is "#", then these subscribers are added to the result set
n, ok := this.snodes[MWC]
if ok {
n.matchQos(qos, subs, qoss)
}
for k, n := range this.snodes { n, ok = this.snodes[SWC]
// If the key is "#", then these subscribers are added to the result set if ok {
if k == MWC { if err := n.smatch(rem, qos, subs, qoss); err != nil {
n.matchQos(qos, subs, qoss) return err
} else if k == SWC || k == level { }
if err := n.smatch(rem, qos, subs, qoss); err != nil { }
return err
} level := string(ntl)
n, ok = this.snodes[level]
if ok {
if err := n.smatch(rem, qos, subs, qoss); err != nil {
return err
} }
} }