From 5caa87adaf6c54a412fcd8a070c4275619e8c410 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Tue, 15 Jun 2021 12:38:35 +0200 Subject: [PATCH] term: no need to set attrs.clean=0 right after copying the VT attrs struct MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When printing a character to a cell, we copy the current VT state’s attributes to the cell. And then clear the ‘clean’ bit. But the ‘clean’ bit is part of the VT state, and is *always* zero. Thus there’s no need to explicitly clear it right after copying the VT state. --- terminal.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/terminal.c b/terminal.c index d5c1c422..9977893a 100644 --- a/terminal.c +++ b/terminal.c @@ -2742,7 +2742,6 @@ print_spacer(struct terminal *term, int col, int remaining) cell->wc = CELL_SPACER + remaining; cell->attrs = term->vt.attrs; - cell->attrs.clean = 0; } void @@ -2792,7 +2791,6 @@ term_print(struct terminal *term, wchar_t wc, int width) row->dirty = true; row->linebreak = false; - cell->attrs.clean = 0; /* Advance cursor the 'additional' columns while dirty:ing the cells */ for (int i = 1; i < width && term->grid->cursor.point.col < term->cols - 1; i++) { @@ -2832,7 +2830,6 @@ ascii_printer_fast(struct terminal *term, wchar_t wc) row->dirty = true; row->linebreak = false; - cell->attrs.clean = 0; /* Advance cursor */ if (unlikely(++term->grid->cursor.point.col >= term->cols)) {