1. Remove redundant variable 'inters'

2. 'gh' variable can be 1 byte instead of 2

This saves 26 bytes of flash memory
This commit is contained in:
Guðni Már Gilbert 2021-08-03 21:46:11 +00:00
parent 05ed5b9668
commit 1946c58d21

View File

@ -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]);