Skip to content

Commit e3c52af

Browse files
committed
Swap logic order in nondterministic descent
1 parent e790cc5 commit e3c52af

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

jsonpath_rfc9535/segments.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,10 @@ def _children(node: JSONPathNode) -> Iterable[JSONPathNode]:
146146
visit_children = random.choice([True, False]) # noqa: S311
147147
for child in _children(_node):
148148
if visit_children:
149-
queue.append(child)
150-
else:
151149
yield child
152150
queue.extend(_children(child))
151+
else:
152+
queue.append(child)
153153

154154
def __str__(self) -> str:
155155
return f"..[{', '.join(str(itm) for itm in self.selectors)}]"

0 commit comments

Comments
 (0)