Ensure Printer buf is always indexed using self.left or self.right
This commit is contained in:
parent
ae28ec5a9c
commit
80139a0f02
1 changed files with 3 additions and 3 deletions
|
@ -336,9 +336,9 @@ impl Printer {
|
|||
|
||||
fn check_stream(&mut self) {
|
||||
if self.right_total - self.left_total > self.space {
|
||||
if Some(&self.left) == self.scan_stack.back() {
|
||||
let scanned = self.scan_stack.pop_back().unwrap();
|
||||
self.buf[scanned].size = SIZE_INFINITY;
|
||||
if self.scan_stack.back() == Some(&self.left) {
|
||||
self.scan_stack.pop_back().unwrap();
|
||||
self.buf[self.left].size = SIZE_INFINITY;
|
||||
}
|
||||
self.advance_left();
|
||||
if self.left != self.right {
|
||||
|
|
Loading…
Add table
Reference in a new issue