Browse Source

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 năm trước cách đây
mục cha
commit
c2bad473dc
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  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);
 	}