From 37b8d5231df8b23833aa69f5cebbd38a671342cd Mon Sep 17 00:00:00 2001 From: Bobby Holley Date: Mon, 6 Feb 2017 13:31:09 -0800 Subject: [PATCH] Bug 1336646 - Move opts check for statistics into should_dump. r=emilio This makes things more consistent between the parallel and sequential traversal drivers. --- components/style/context.rs | 3 ++- components/style/parallel.rs | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/style/context.rs b/components/style/context.rs index 49141c7cf2ec..ec66f01b2b5f 100644 --- a/components/style/context.rs +++ b/components/style/context.rs @@ -15,6 +15,7 @@ use euclid::Size2D; use matching::StyleSharingCandidateCache; use parking_lot::RwLock; use properties::ComputedValues; +use servo_config::opts; use std::collections::HashMap; use std::env; use std::fmt; @@ -160,7 +161,7 @@ lazy_static! { impl TraversalStatistics { /// Returns whether statistics dumping is enabled. pub fn should_dump() -> bool { - *DUMP_STYLE_STATISTICS + *DUMP_STYLE_STATISTICS || opts::get().style_sharing_stats } } diff --git a/components/style/parallel.rs b/components/style/parallel.rs index 3cc521e05332..dc3d31f53143 100644 --- a/components/style/parallel.rs +++ b/components/style/parallel.rs @@ -26,7 +26,6 @@ use context::TraversalStatistics; use dom::{OpaqueNode, SendNode, TElement, TNode}; use rayon; use scoped_tls::ScopedTLS; -use servo_config::opts; use std::borrow::Borrow; use traversal::{DomTraversal, PerLevelTraversalData, PreTraverseToken}; @@ -75,7 +74,7 @@ pub fn traverse_dom(traversal: &D, }); // Dump statistics to stdout if requested. - if TraversalStatistics::should_dump() || opts::get().style_sharing_stats { + if TraversalStatistics::should_dump() { let slots = unsafe { tls.unsafe_get() }; let aggregate = slots.iter().fold(TraversalStatistics::default(), |acc, t| { match *t.borrow() {