Replies: 1 comment
-
Thanks, that is an interesting point. Currently, However, maybe EDIT: I think we already have a |
Beta Was this translation helpful? Give feedback.
-
Thanks, that is an interesting point. Currently, However, maybe EDIT: I think we already have a |
Beta Was this translation helpful? Give feedback.
-
After looking at the code I'm pretty sure the answer to this is no, but just wanted to make sure: there's currently no way to stop traversal of a tree once
node.traverse(...)
has been called, correct?My current use case is that I want to do a tree search for functions of a particular variable, but stopping on the first match. I have something like:
But this is not ideal as it will continue to traverse the tree in it's entirety wasting cycles and possibly giving me the wrong result. What would be nicer is if I could do something like this to stop early:
@josdejong If I'm correct that this is currently not possible, would you accept a PR for it?
Beta Was this translation helpful? Give feedback.
All reactions