mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
apply profile filter to top-level entries only
This commit is contained in:
parent
bf801953a3
commit
4dd7faed34
1 changed files with 6 additions and 7 deletions
|
@ -76,17 +76,16 @@ pub fn profile(desc: &str) -> Profiler {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if stack.starts.len() > stack.filter_data.depth {
|
if stack.starts.len() > stack.filter_data.depth {
|
||||||
return Profiler { desc: None };
|
return Profiler { desc: None };
|
||||||
}
|
}
|
||||||
|
let allowed = &stack.filter_data.allowed;
|
||||||
|
if stack.starts.is_empty() && !allowed.is_empty() && !allowed.contains(desc) {
|
||||||
|
return Profiler { desc: None };
|
||||||
|
}
|
||||||
|
|
||||||
if stack.filter_data.allowed.is_empty() || stack.filter_data.allowed.contains(desc) {
|
|
||||||
stack.starts.push(Instant::now());
|
stack.starts.push(Instant::now());
|
||||||
Profiler { desc: Some(desc.to_string()) }
|
Profiler { desc: Some(desc.to_string()) }
|
||||||
} else {
|
|
||||||
Profiler { desc: None }
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue