Selaa lähdekoodia

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
Guðni Már Gilbert 2 vuotta sitten
vanhempi
commit
c2bad473dc
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  1. 1 1
      Firmware/menu.cpp

+ 1 - 1
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<T>(' ', _md->editLabel, (int)lcd_encoder);
 	}