diff options
author | nicm <nicm> | 2019-09-24 20:44:58 +0000 |
---|---|---|
committer | nicm <nicm> | 2019-09-24 20:44:58 +0000 |
commit | e3359f8349cf972052604c089b5bab71f5e33095 (patch) | |
tree | 1604049179d85325334658c5447d0e1875a806ee /grid.c | |
parent | e8adcae0f24c6089cae9c60e7b087a00a582f9f9 (diff) | |
download | rtmux-e3359f8349cf972052604c089b5bab71f5e33095.tar.gz rtmux-e3359f8349cf972052604c089b5bab71f5e33095.tar.bz2 rtmux-e3359f8349cf972052604c089b5bab71f5e33095.zip |
Some minor performance improvements - most notably, don't search the
input state table if the next character matches the same state as before.
Diffstat (limited to 'grid.c')
-rw-r--r-- | grid.c | 22 |
1 files changed, 12 insertions, 10 deletions
@@ -186,17 +186,19 @@ grid_clear_cell(struct grid *gd, u_int px, u_int py, u_int bg) struct grid_cell *gc; memcpy(gce, &grid_cleared_entry, sizeof *gce); - if (bg & COLOUR_FLAG_RGB) { - grid_get_extended_cell(gl, gce, gce->flags); - gl->flags |= GRID_LINE_EXTENDED; + if (bg != 8) { + if (bg & COLOUR_FLAG_RGB) { + grid_get_extended_cell(gl, gce, gce->flags); + gl->flags |= GRID_LINE_EXTENDED; - gc = &gl->extddata[gce->offset]; - memcpy(gc, &grid_cleared_cell, sizeof *gc); - gc->bg = bg; - } else { - if (bg & COLOUR_FLAG_256) - gce->flags |= GRID_FLAG_BG256; - gce->data.bg = bg; + gc = &gl->extddata[gce->offset]; + memcpy(gc, &grid_cleared_cell, sizeof *gc); + gc->bg = bg; + } else { + if (bg & COLOUR_FLAG_256) + gce->flags |= GRID_FLAG_BG256; + gce->data.bg = bg; + } } } |