Cache the number of children of each node

This commit is contained in:
Anthony Ramine 2015-07-25 02:13:35 +02:00
parent a54404c921
commit a49eb14615
3 changed files with 46 additions and 17 deletions

View file

@ -237,6 +237,10 @@ impl<'ln> LayoutNode<'ln> {
self.node.next_sibling_ref().map(|node| self.new_with_this_lifetime(&node))
}
}
pub fn children_count(&self) -> u32 {
unsafe { self.node.children_count() }
}
}
impl<'ln> LayoutNode<'ln> {