Merge pull request #4206 from gudnimg/sd-card-menu-opt

optimisation: `menu_item == menu_line` is always true in `menu_item_sddir()` and `menu_item_sdfile()`
This commit is contained in:
3d-gussner 2023-09-13 07:49:43 +02:00 committed by GitHub
commit 0aa380b931
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 20 additions and 26 deletions

View File

@ -279,8 +279,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)
{ {
lcd_implementation_drawmenu_sddirectory(menu_row, (str_fnl[0] == '\0') ? str_fn : str_fnl); lcd_implementation_drawmenu_sddirectory(menu_row, (str_fnl[0] == '\0') ? str_fn : str_fnl);
@ -293,14 +291,11 @@ 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)
{ {
lcd_implementation_drawmenu_sdfile(menu_row, (str_fnl[0] == '\0') ? str_fn : str_fnl); lcd_implementation_drawmenu_sdfile(menu_row, (str_fnl[0] == '\0') ? str_fn : str_fnl);
@ -313,7 +308,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++;
} }