diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2021-03-07 13:59:10 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2021-03-11 16:32:58 +0000 |
| commit | 777576b66b1fff8d6da5696aac062aaa0dea1bb4 (patch) | |
| tree | 6b0462beb84df9e0774c1e1fdea77996fd167f07 | |
| parent | sixel: add optimized resize_horizontally() and resize_vertically() (diff) | |
sixel: decgri: avoid load inside for-loop
| -rw-r--r-- | sixel.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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; |
