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-09 05:44:17 +0000 |
| commit | 0a5a6cb7fa58577989716976a3430a9de4cac860 (patch) | |
| tree | 5ac0078c5a3d8ad9a1c6a9f94918bb62fd5012c3 | |
| 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) { |
