From 9682e15deb2037b4da2b9796be81bd3f80e1a153 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Tue, 2 Jul 2019 22:18:25 +0200 Subject: term: "cache" pointer to current line This adds a pointer to the first cell on the current line. This pointer must be updated every time the row changes. The advantage is mainly that PRINT doesn't have to call grid_get_range(), which is fairly expensive. --- vt.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'vt.c') diff --git a/vt.c b/vt.c index 5d04008b..f2d85d4b 100644 --- a/vt.c +++ b/vt.c @@ -678,11 +678,7 @@ action(struct terminal *term, enum action action, uint8_t c) term_cursor_to(term, term->cursor.row + 1, 0); } - size_t cell_count = 1; - struct cell *cell = grid_get_range( - term->grid, term->cursor.linear, &cell_count); - assert(cell_count == 1); - + struct cell *cell = &term->grid->cur_line[term->cursor.col]; term_damage_update(term, term->cursor.linear, 1); if (term->vt.utf8.idx > 0) { -- cgit v1.3