Skip to content

Commit

Permalink
Do not create useless variable len
Browse files Browse the repository at this point in the history
  • Loading branch information
spoutn1k authored and djc committed Nov 15, 2024
1 parent 62697bb commit 0766924
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/draw_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,6 @@ impl DrawState {

let term_height = term.height() as usize;
let term_width = term.width() as usize;
let len = self.lines.len();
debug_assert!(self.orphan_lines_count <= self.lines.len());
let orphan_visual_line_count =
self.visual_line_count(..self.orphan_lines_count, term_width);
Expand Down Expand Up @@ -550,7 +549,7 @@ impl DrawState {
term.write_line("")?;
}
term.write_str(line)?;
if idx + 1 == len {
if idx + 1 == self.lines.len() {
// Keep the cursor on the right terminal side
// So that next user writes/prints will happen on the next line
last_line_filler = term_width.saturating_sub(line_width);
Expand Down

0 comments on commit 0766924

Please sign in to comment.