Skip to main content

drop_node_iteratively

Function drop_node_iteratively 

Source
pub fn drop_node_iteratively<T: Terminal, F: Function>(node: TreeNode<T, F>)
Expand description

Free a tree node and all of its descendants without deep recursion.

EV-60: TreeNode now has a stack-safe Drop impl, so simply dropping a node already frees an arbitrarily deep tree iteratively. This helper is retained as an explicit, self-documenting entry point (and for source compatibility) but is no longer required to avoid a stack overflow — a plain drop(node) or letting the node fall out of scope is equally safe.