aboutsummaryrefslogtreecommitdiff
path: root/sixel.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-03-14 13:19:12 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-03-14 13:19:12 +0000
commitc5c3447ca8a71ab3cfd84a2b5fd2c193ef5b4fb4 (patch)
treeb7855c389ad7cac0901bec6a4599767e4e6a8f15 /sixel.c
parentMerge branch 'sixel-fix-max-geometry' (diff)
sixel: sixel_overwrite_at_cursor(): early exit when the image list is empty
This avoids a call to sixel_overwrite_by_row() (where we also exit early if the image list is empty). This saves a couple of instructions to set up the arguments for sixel_overwrite_by_row().
Diffstat (limited to 'sixel.c')
-rw-r--r--sixel.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sixel.c b/sixel.c
index 96ba9214..be4981cf 100644
--- a/sixel.c
+++ b/sixel.c
@@ -610,6 +610,9 @@ sixel_overwrite_by_row(struct terminal *term, int _row, int col, int width)
void
sixel_overwrite_at_cursor(struct terminal *term, int width)
{
+ if (likely(tll_length(term->grid->sixel_images) == 0))
+ return;
+
sixel_overwrite_by_row(
term, term->grid->cursor.point.row, term->grid->cursor.point.col, width);
}