diff options
| author | David Tolnay <dtolnay@gmail.com> | 2022-01-19 18:27:26 -0800 |
|---|---|---|
| committer | David Tolnay <dtolnay@gmail.com> | 2022-01-19 18:32:18 -0800 |
| commit | d81740ed2a63d377a725b0fbf935c391f5c7eb5e (patch) | |
| tree | eb49e205515e3a021513bbbf383df93d061f99ac /src/test/codegen/gdb_debug_script_load.rs | |
| parent | eec6016ec3e0cc6be3ae75007586b6a56372b382 (diff) | |
| download | rust-d81740ed2a63d377a725b0fbf935c391f5c7eb5e.tar.gz rust-d81740ed2a63d377a725b0fbf935c391f5c7eb5e.zip | |
Grow scan_stack in the conventional direction
The pretty printer algorithm involves 2 VecDeques: a ring-buffer of tokens and a deque of ring-buffer indices. Confusingly, those two deques were being grown in opposite directions for no good reason. Ring-buffer pushes would go on the "back" of the ring-buffer (i.e. higher indices) while scan_stack pushes would go on the "front" (i.e. lower indices). This commit flips the scan_stack accesses to grow the scan_stack and ring-buffer in the same direction, where push does the same operation as a Vec push i.e. inserting on the high-index end.
Diffstat (limited to 'src/test/codegen/gdb_debug_script_load.rs')
0 files changed, 0 insertions, 0 deletions
