From 1946c58d21cf60cdbeeb2d49a4769e96e7981f58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Tue, 3 Aug 2021 21:46:11 +0000 Subject: [PATCH] 1. Remove redundant variable 'inters' 2. 'gh' variable can be 1 byte instead of 2 This saves 26 bytes of flash memory --- Firmware/ultralcd.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 91010b69..e580eba3 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -610,15 +610,14 @@ void lcdui_print_status_line(void) else if ((IS_SD_PRINTING) && (custom_message_type == CustomMsg::Status)) { // If printing from SD, show what we are printing const char* longFilenameOLD = (card.longFilename[0] ? card.longFilename : card.filename); if(strlen(longFilenameOLD) > LCD_WIDTH) { - int inters = 0; - int gh = scrollstuff; - while (((gh - scrollstuff) < LCD_WIDTH) && (inters == 0)) { + uint8_t gh = scrollstuff; + while (((gh - scrollstuff) < LCD_WIDTH)) { if (longFilenameOLD[gh] == '\0') { lcd_set_cursor(gh - scrollstuff, 3); lcd_print(longFilenameOLD[gh - 1]); scrollstuff = 0; gh = scrollstuff; - inters = 1; + break; } else { lcd_set_cursor(gh - scrollstuff, 3); lcd_print(longFilenameOLD[gh - 1]);