Skip to content

Commit

Permalink
Eliminate a check_stack call on an empty scan stack
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Jan 19, 2022
1 parent 377c9db commit fe5c4ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/rustc_ast_pretty/src/pp.rs
Expand Up @@ -315,8 +315,8 @@ impl Printer {
} else {
self.right += 1;
self.buf.advance_right();
self.check_stack(0);
}
self.check_stack(0);
self.buf[self.right] = BufEntry { token: Token::Break(b), size: -self.right_total };
self.scan_stack.push_front(self.right);
self.right_total += b.blank_space;
Expand Down

0 comments on commit fe5c4ea

Please sign in to comment.