Skip to content

Commit

Permalink
Refactor setActiveWidget method for BaseItemManyWidgets
Browse files Browse the repository at this point in the history
Simplify condition to set active widget, removing redundant check.
  • Loading branch information
forntoh committed Oct 21, 2024
1 parent 7eafa3c commit 9c40621
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/BaseItemManyWidgets.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class BaseItemManyWidgets : public MenuItem {

uint8_t getActiveWidget() const { return activeWidget; }
void setActiveWidget(const uint8_t activeWidget) {
if (activeWidget >= 0 && activeWidget < size) {
if (activeWidget < size) {
this->activeWidget = activeWidget;
}
}
Expand Down

0 comments on commit 9c40621

Please sign in to comment.