Skip to content

Commit

Permalink
Change order of find_child_recursive parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoburns committed Sep 25, 2023
1 parent 894945a commit adfe072
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/tree/taffy_tree/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,12 @@ impl<'a> Iterator for RefCellVecIter<'a> {

/// Iterates over children, checking the Display type of the node
/// If the node is `Display::Contents`, then we recurse it's children, else we simply push the `NodeId` into the list
fn find_children_recursive(out: &mut Vec<NodeId>, tree: &Taffy, node: NodeId) {
fn find_children_recursive(tree: &Taffy, node: NodeId, out: &mut Vec<NodeId>) {
for child_id in tree.children[node.into()].iter() {
let child_key: DefaultKey = (*child_id).into();
let display = tree.nodes[child_key].style.display;
match display {
Display::Contents => find_children_recursive(out, tree, *child_id),
Display::Contents => find_children_recursive(tree, *child_id, out),
_ => out.push(*child_id),
}
}
Expand All @@ -120,7 +120,7 @@ impl LayoutTree for Taffy {
if cache.node_id != node {
cache.node_id = node;
cache.children.clear();
find_children_recursive(&mut cache.children, self, node);
find_children_recursive(self, node, &mut cache.children);
}

// In all cases, return a reference into the cache
Expand Down

0 comments on commit adfe072

Please sign in to comment.