mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-04 04:06:06 -05:00
sixel: scroll up/down: early return when list is empty
Branch tagged as ‘likely’ for performance reason
This commit is contained in:
parent
984083bf19
commit
0a5a6cb7fa
1 changed files with 6 additions and 0 deletions
6
sixel.c
6
sixel.c
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue