libansilove

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

commit 496ef1cbb8f9d000db0dfaa19c3ef866102f3023
parent 67b9452fb87b101faa3c2ab8bbd5c1aea9ea67bd
Author: Frederic Cambus <fred@statdns.com>
Date:   Mon, 28 Sep 2020 12:27:49 +0200

Don't use intermediate variables to grab chars out of the structure.

Diffstat:
Msrc/loaders/pcboard.c | 13+++++--------
1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/src/loaders/pcboard.c b/src/loaders/pcboard.c @@ -177,15 +177,12 @@ ansilove_pcboard(struct ansilove_ctx *ctx, struct ansilove_options *options) /* render PCB */ for (loop = 0; loop < structIndex; loop++) { - /* grab our chars out of the structure */ - column = pcboard_buffer[loop].column; - row = pcboard_buffer[loop].row; - background = pcboard_buffer[loop].background; - foreground = pcboard_buffer[loop].foreground; - character = pcboard_buffer[loop].character; - drawchar(canvas, fontData.font_data, options->bits, fontData.height, - column, row, colors[background], colors[foreground], character); + pcboard_buffer[loop].column, + pcboard_buffer[loop].row, + colors[pcboard_buffer[loop].background], + colors[pcboard_buffer[loop].foreground], + pcboard_buffer[loop].character); } /* create output image */