optimisation: menu_item == menu_line is always true

The if statement is checked in lcd_sdcard_menu()

so checking it again these functions is
redundant since it's always going to be true.

Tested on MK3S+

Change in memory:
Flash: -22 bytes
SRAM: 0 bytes
This commit is contained in:
Guðni Már Gilbert 2023-05-14 10:27:02 +00:00
parent 2a71e681db
commit cabc44194a
1 changed files with 20 additions and 26 deletions

View File

@ -276,8 +276,6 @@ static void lcd_implementation_drawmenu_sddirectory(uint8_t row, const char* lon
static void menu_item_sddir(const char* str_fn, char* str_fnl) static void menu_item_sddir(const char* str_fn, char* str_fnl)
{
if (menu_item == menu_line)
{ {
if (lcd_draw_update) if (lcd_draw_update)
{ {
@ -291,13 +289,10 @@ static void menu_item_sddir(const char* str_fn, char* str_fnl)
menu_item_ret(); menu_item_ret();
return; return;
} }
}
menu_item++; menu_item++;
} }
static void menu_item_sdfile(const char* str_fn, char* str_fnl) static void menu_item_sdfile(const char* str_fn, char* str_fnl)
{
if (menu_item == menu_line)
{ {
if (lcd_draw_update) if (lcd_draw_update)
{ {
@ -311,7 +306,6 @@ static void menu_item_sdfile(const char* str_fn, char* str_fnl)
menu_item_ret(); menu_item_ret();
return; return;
} }
}
menu_item++; menu_item++;
} }