Skip to content

Commit 474ca79

Browse files
author
JJW
authored
Merge pull request #59 from yomorun/bug/subscribe
bug(observable): endless loop
2 parents 376a618 + b88dc3b commit 474ca79

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

observable.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,11 @@ func filterRoot(observe <-chan interface{}) <-chan interface{} {
258258

259259
b := buf[i]
260260

261-
if rootflow == 0 && ((b<<2)>>2 == rootkey) {
262-
rootflow = 1
263-
rootBuffer = append(rootBuffer, b)
261+
if rootflow == 0 {
262+
if (b<<2)>>2 == rootkey {
263+
rootflow = 1
264+
rootBuffer = append(rootBuffer, b)
265+
}
264266
i++
265267
continue
266268
}

0 commit comments

Comments
 (0)