diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2020-10-04 17:28:22 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2020-10-11 17:25:56 +0000 |
| commit | eec097173979d198042447739a687891ebae1ac6 (patch) | |
| tree | d33d3af09d5d91f5de140c3f31a482c6af3df52b | |
| parent | sixel: cell-size-changed: don’t verify sixels here (diff) | |
sixel: scroll up/down: early return when list is empty
Branch tagged as ‘likely’ for performance reason
| -rw-r--r-- | sixel.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -242,6 +242,9 @@ out: void sixel_scroll_up(struct terminal *term, int rows) { + if (likely(tll_length(term->grid->sixel_images) == 0)) + return; + tll_rforeach(term->grid->sixel_images, it) { struct sixel *six = &it->item; @@ -269,6 +272,9 @@ sixel_scroll_up(struct terminal *term, int rows) void sixel_scroll_down(struct terminal *term, int rows) { + if (likely(tll_length(term->grid->sixel_images) == 0)) + return; + assert(term->grid->num_rows >= rows); tll_foreach(term->grid->sixel_images, it) { |
