Don't create unneeded temporaries in style traversals.

This commit is contained in:
Emilio Cobos Álvarez 2016-08-10 11:26:49 -07:00
parent d1090065f7
commit 9b8eac000f
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
2 changed files with 7 additions and 19 deletions

View file

@ -17,12 +17,7 @@ pub fn traverse_dom<N, C>(root: N,
C: DomTraversalContext<N>
{
debug_assert!(context.should_process(node));
let should_stop = match context.process_preorder(node) {
RestyleResult::Stop => true,
RestyleResult::Continue => false,
};
if !should_stop {
if let RestyleResult::Continue = context.process_preorder(node) {
for kid in node.children() {
context.pre_process_child_hook(node, kid);
if context.should_process(kid) {