mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-08 10:06:22 -05:00
term: tail-call optimize calls to grid_row_uri_range_erase()
This commit is contained in:
parent
09a331857a
commit
53fc1a1cb1
1 changed files with 8 additions and 2 deletions
10
terminal.c
10
terminal.c
|
|
@ -3209,7 +3209,7 @@ term_print(struct terminal *term, wchar_t wc, int width)
|
|||
row->dirty = true;
|
||||
row->linebreak = true;
|
||||
|
||||
grid_row_uri_range_erase(row, col, col + width - 1);
|
||||
int uri_start = col;
|
||||
|
||||
/* Advance cursor the 'additional' columns while dirty:ing the cells */
|
||||
for (int i = 1; i < width && col < term->cols - 1; i++) {
|
||||
|
|
@ -3225,6 +3225,9 @@ term_print(struct terminal *term, wchar_t wc, int width)
|
|||
xassert(!grid->cursor.lcf);
|
||||
|
||||
grid->cursor.point.col = col;
|
||||
|
||||
if (unlikely(row->extra != NULL))
|
||||
grid_row_uri_range_erase(row, uri_start, uri_start + width - 1);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -3255,7 +3258,7 @@ ascii_printer_fast(struct terminal *term, wchar_t wc)
|
|||
row->dirty = true;
|
||||
row->linebreak = true;
|
||||
|
||||
grid_row_uri_range_erase(row, col, col);
|
||||
int uri_start = col;
|
||||
|
||||
/* Advance cursor */
|
||||
if (unlikely(++col >= term->cols)) {
|
||||
|
|
@ -3265,6 +3268,9 @@ ascii_printer_fast(struct terminal *term, wchar_t wc)
|
|||
xassert(!grid->cursor.lcf);
|
||||
|
||||
grid->cursor.point.col = col;
|
||||
|
||||
if (unlikely(row->extra != NULL))
|
||||
grid_row_uri_range_erase(row, uri_start, uri_start);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue