From d9b7a8572294f0bf950ef4944e2fc68edb1b5446 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sat, 27 Jun 2020 12:50:39 +0200 Subject: [PATCH] sixel: split: push front instead of back This reduces the burden on sixel_split_by_rectangle(), which would otherwise consider the newly added/splitted sixels. Since we already know they aren't covered by the specified rectangle, we can skip that. --- sixel.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sixel.c b/sixel.c index 8869e46f..f04a8d7e 100644 --- a/sixel.c +++ b/sixel.c @@ -197,7 +197,7 @@ sixel_split(struct terminal *term, struct sixel *six, PIXMAN_a8r8g8b8, above.width, above.height, above.data, above.width * sizeof(uint32_t)); - tll_push_back(term->grid->sixel_images, above); + tll_push_front(term->grid->sixel_images, above); } if (rel_below < six->rows) { @@ -219,7 +219,7 @@ sixel_split(struct terminal *term, struct sixel *six, PIXMAN_a8r8g8b8, below.width, below.height, below.data, below.width * sizeof(uint32_t)); - tll_push_back(term->grid->sixel_images, below); + tll_push_front(term->grid->sixel_images, below); } if (rel_left > 0) { @@ -242,7 +242,7 @@ sixel_split(struct terminal *term, struct sixel *six, PIXMAN_a8r8g8b8, left.width, left.height, left.data, left.width * sizeof(uint32_t)); - tll_push_back(term->grid->sixel_images, left); + tll_push_front(term->grid->sixel_images, left); } if (rel_right < six->cols) { @@ -265,7 +265,7 @@ sixel_split(struct terminal *term, struct sixel *six, PIXMAN_a8r8g8b8, right.width, right.height, right.data, right.width * sizeof(uint32_t)); - tll_push_back(term->grid->sixel_images, right); + tll_push_front(term->grid->sixel_images, right); } }