From c2bad473dc9f2bfd9d0e086303e4755e5ff197cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Sun, 6 Feb 2022 09:01:16 +0000 Subject: [PATCH] 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 --- Firmware/menu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/menu.cpp b/Firmware/menu.cpp index 30951bbc..86b9047e 100755 --- a/Firmware/menu.cpp +++ b/Firmware/menu.cpp @@ -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(' ', _md->editLabel, (int)lcd_encoder); }