libansilove

Library for converting ANSI, ASCII, and other formats to PNG
Log | Files | Refs | README | LICENSE

commit 2d2f258440a7da47dfa7000c350a1d1304087cf8
parent 38279fac64a0e3aa428eaea03a40c00a92452de0
Author: Frederic Cambus <fred@statdns.com>
Date:   Fri,  4 Oct 2019 09:43:10 +0200

No need to use another intermediate variable, we can use structIndex.

Diffstat:
Msrc/loaders/ansi.c | 5+----
Msrc/loaders/pcboard.c | 4+---
2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/src/loaders/ansi.c b/src/loaders/ansi.c @@ -498,11 +498,8 @@ ansilove_ansi(struct ansilove_ctx *ctx, struct ansilove_options *options) } } - /* even more definitions, sigh */ - uint32_t ansiBufferItems = structIndex; - /* render ANSi */ - for (loop = 0; loop < ansiBufferItems; loop++) { + for (loop = 0; loop < structIndex; loop++) { /* grab ANSi char from our structure array */ background = ansi_buffer[loop].background; foreground = ansi_buffer[loop].foreground; diff --git a/src/loaders/pcboard.c b/src/loaders/pcboard.c @@ -173,10 +173,8 @@ ansilove_pcboard(struct ansilove_ctx *ctx, struct ansilove_options *options) ansi_palette[i*3+2]); } - uint32_t pcbBufferItems = structIndex; - /* render PCB */ - for (loop = 0; loop < pcbBufferItems; loop++) { + for (loop = 0; loop < structIndex; loop++) { /* grab our chars out of the structure */ column = pcboard_buffer[loop].column; row = pcboard_buffer[loop].row;