Skip to content

Conversation

@kddnewton
Copy link
Collaborator

No description provided.

@kddnewton kddnewton merged commit 0f57d62 into main Jan 27, 2026
66 checks passed
@kddnewton kddnewton deleted the find-all branch January 27, 2026 20:16
Comment on lines +220 to +221
# Returns all of the nodes that match the given block when visited in a
# breadth-first search. This is useful for finding all nodes that match a
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For finding all nodes matching something, maybe a depth-first search would be faster?
I'm unsure if the order matters much in such cases, but maybe?

I'm thinking aliasing to find_all might be suboptimal if there is a DFS variant at some point.


nil
end
alias find breadth_first_search
Copy link
Member

@eregon eregon Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing here, find might be better/faster for/with DFS, especially for the example shown with node_id.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I thought about that too. But I figured we can cross that bridge when we get to it if we really need to add a DFS variant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants