Skip to content

Commit

Permalink
fix position(), last() repeats called in the same node. antchfx/jsonq…
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengchun committed May 8, 2020
1 parent c407737 commit 9f7395f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions func.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func predicate(q query) func(NodeNavigator) bool {
func positionFunc(q query, t iterator) interface{} {
var (
count = 1
node = t.Current()
node = t.Current().Copy()
)
test := predicate(q)
for node.MoveToPrevious() {
Expand All @@ -40,7 +40,7 @@ func positionFunc(q query, t iterator) interface{} {
func lastFunc(q query, t iterator) interface{} {
var (
count = 0
node = t.Current()
node = t.Current().Copy()
)
node.MoveToFirst()
test := predicate(q)
Expand Down

0 comments on commit 9f7395f

Please sign in to comment.