From 49b50f2f7dede3c5fe85ebfc883cbf6146171a8f Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Sun, 19 Jan 2025 20:26:28 +0100 Subject: [PATCH] [screen] do not test bitfield twice --- src/terminal/screen.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/terminal/screen.c b/src/terminal/screen.c index f4639c9c9..8ec56388a 100644 --- a/src/terminal/screen.c +++ b/src/terminal/screen.c @@ -1423,14 +1423,14 @@ add_char_true(struct string *screen, struct screen_driver *driver, int ymax = (term_)->height - 1; \ \ for (; y <= ymax; y++) { \ - if (!test_bitfield_bit(screen->dirty, y) && !test_bitfield_bit(screen->dirty_image, y)) continue; \ + int dirty = test_bitfield_bit(screen->dirty_image, y); \ + if (!dirty && !test_bitfield_bit(screen->dirty, y)) continue; \ int ypos = y * (term_)->width; \ struct screen_char *current = &screen->last_image[ypos]; \ struct screen_char *pos = &screen->image[ypos]; \ struct screen_char *start_of_line = pos; \ int is_last_line = (y == ymax); \ int x = 0; \ - int dirty = test_bitfield_bit(screen->dirty_image, y); \ clear_bitfield_bit(screen->dirty, y); \ clear_bitfield_bit(screen->dirty_image, y); \ \