1
0
Fork 0

[screen] minor optimisation

This commit is contained in:
Witold Filipczyk 2022-12-14 22:18:10 +01:00
parent 571cb05e05
commit df5dd1515e
1 changed files with 5 additions and 4 deletions

View File

@ -1507,7 +1507,6 @@ resize_screen(struct terminal *term, int width, int height)
{
struct terminal_screen *screen;
struct screen_char *image;
struct bitfield *new_dirty;
size_t size, bsize;
assert(term && term->screen);
@ -1520,8 +1519,11 @@ resize_screen(struct terminal *term, int width, int height)
size = width * height;
if (size <= 0) return;
new_dirty = init_bitfield(height);
if (!new_dirty) return;
if (term->height != height) {
struct bitfield *new_dirty = init_bitfield(height);
if (!new_dirty) return;
mem_free_set(&screen->dirty, new_dirty);
}
bsize = size * sizeof(*image);
@ -1536,7 +1538,6 @@ resize_screen(struct terminal *term, int width, int height)
term->width = width;
term->height = height;
mem_free_set(&screen->dirty, new_dirty);
set_screen_dirty(screen, 0, height);
}