aboutsummaryrefslogtreecommitdiff
path: root/sixel.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-03-07 13:59:10 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-03-11 16:32:58 +0000
commit777576b66b1fff8d6da5696aac062aaa0dea1bb4 (patch)
tree6b0462beb84df9e0774c1e1fdea77996fd167f07 /sixel.c
parentsixel: add optimized resize_horizontally() and resize_vertically() (diff)
sixel: decgri: avoid load inside for-loop
Diffstat (limited to 'sixel.c')
-rw-r--r--sixel.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sixel.c b/sixel.c
index 7ff5780d..10aa1f94 100644
--- a/sixel.c
+++ b/sixel.c
@@ -1158,9 +1158,10 @@ decgri(struct terminal *term, uint8_t c)
case 'w': case 'x': case 'y': case 'z': case '{': case '|': case '}':
case '~': {
//LOG_DBG("repeating '%c' %u times", c, term->sixel.param);
+ unsigned count = term->sixel.param;
uint32_t color = term->sixel.palette[term->sixel.color_idx];
- for (unsigned i = 0; i < term->sixel.param; i++)
+ for (unsigned i = 0; i < count; i++)
sixel_add(term, color, c - 63);
term->sixel.state = SIXEL_DECSIXEL;