Skip to content

Commit

Permalink
Add .trim() before line filtering to catch whitespace-only lines
Browse files Browse the repository at this point in the history
  • Loading branch information
mrob95 committed May 8, 2022
1 parent 12c8b0d commit 8d4cf04
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/flamegraph/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,10 @@ where
W: Write,
{
let mut reversed = StrStack::new();
let lines = lines.into_iter().filter(|line| !(line.is_empty() || line.starts_with("# ")));
let lines = lines
.into_iter()
.map(|line| line.trim())
.filter(|line| !(line.is_empty() || line.starts_with("# ")));

let (mut frames, time, ignored, delta_max) = if opt.reverse_stack_order {
if opt.no_sort {
Expand Down

0 comments on commit 8d4cf04

Please sign in to comment.