mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-13 05:33:51 -04:00
sixel: decgri: avoid load inside for-loop
This commit is contained in:
parent
9f224a13df
commit
777576b66b
1 changed files with 2 additions and 1 deletions
3
sixel.c
3
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 'w': case 'x': case 'y': case 'z': case '{': case '|': case '}':
|
||||||
case '~': {
|
case '~': {
|
||||||
//LOG_DBG("repeating '%c' %u times", c, term->sixel.param);
|
//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];
|
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);
|
sixel_add(term, color, c - 63);
|
||||||
|
|
||||||
term->sixel.state = SIXEL_DECSIXEL;
|
term->sixel.state = SIXEL_DECSIXEL;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue