diff options
Diffstat (limited to 'crates/ra_prof/src/lib.rs')
-rw-r--r-- | crates/ra_prof/src/lib.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/crates/ra_prof/src/lib.rs b/crates/ra_prof/src/lib.rs index 031405879..e681b8e0b 100644 --- a/crates/ra_prof/src/lib.rs +++ b/crates/ra_prof/src/lib.rs | |||
@@ -76,17 +76,16 @@ pub fn profile(desc: &str) -> Profiler { | |||
76 | } | 76 | } |
77 | }; | 77 | }; |
78 | } | 78 | } |
79 | |||
80 | if stack.starts.len() > stack.filter_data.depth { | 79 | if stack.starts.len() > stack.filter_data.depth { |
81 | return Profiler { desc: None }; | 80 | return Profiler { desc: None }; |
82 | } | 81 | } |
83 | 82 | let allowed = &stack.filter_data.allowed; | |
84 | if stack.filter_data.allowed.is_empty() || stack.filter_data.allowed.contains(desc) { | 83 | if stack.starts.is_empty() && !allowed.is_empty() && !allowed.contains(desc) { |
85 | stack.starts.push(Instant::now()); | 84 | return Profiler { desc: None }; |
86 | Profiler { desc: Some(desc.to_string()) } | ||
87 | } else { | ||
88 | Profiler { desc: None } | ||
89 | } | 85 | } |
86 | |||
87 | stack.starts.push(Instant::now()); | ||
88 | Profiler { desc: Some(desc.to_string()) } | ||
90 | }) | 89 | }) |
91 | } | 90 | } |
92 | 91 | ||