Optimise _menu_edit_P

If the first if statement is true, then we don't need to check the next if statement.

Saves 64 bytes of flash memory
This commit is contained in:
Guðni Már Gilbert 2022-02-06 09:01:16 +00:00
parent 70cb30208c
commit c2bad473dc

View File

@ -509,7 +509,7 @@ static void _menu_edit_P(void)
if (lcd_draw_update)
{
if (lcd_encoder < _md->minEditValue) lcd_encoder = _md->minEditValue;
if (lcd_encoder > _md->maxEditValue) lcd_encoder = _md->maxEditValue;
else if (lcd_encoder > _md->maxEditValue) lcd_encoder = _md->maxEditValue;
lcd_set_cursor(0, 1);
menu_draw_P<T>(' ', _md->editLabel, (int)lcd_encoder);
}