mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Cache the number of children of each node
This commit is contained in:
parent
a54404c921
commit
a49eb14615
3 changed files with 46 additions and 17 deletions
|
@ -123,8 +123,7 @@ pub trait ParallelPreorderDomTraversal : PreorderDomTraversal {
|
|||
// Perform the appropriate traversal.
|
||||
self.process(node);
|
||||
|
||||
// NB: O(n).
|
||||
let child_count = node.children().count();
|
||||
let child_count = node.children_count();
|
||||
|
||||
// Reset the count of children.
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue