From 777576b66b1fff8d6da5696aac062aaa0dea1bb4 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sun, 7 Mar 2021 14:59:10 +0100 Subject: sixel: decgri: avoid load inside for-loop --- sixel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- cgit v1.3