We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 18161e6 commit eda4487Copy full SHA for eda4487
src/tree/taffy_tree/tree.rs
@@ -100,9 +100,9 @@ impl LayoutTree for Taffy {
100
fn children(&self, node: NodeId) -> Self::ChildIter<'_> {
101
let mut cache = self.node_children_cache.borrow_mut();
102
if cache.0 != node {
103
- let mut children = Vec::with_capacity(self.children.len());
104
- find_children_recursive(&mut children, self, node);
105
- *cache = (node, children);
+ cache.1.clear();
+ cache.0 = node;
+ find_children_recursive(&mut cache.1, self, node);
106
}
107
RefCellVecIter { children: RefMut::map(cache, |c| &mut c.1), index: 0 }
108
0 commit comments