Skip to content

Commit 019dcc7

Browse files
Removed un-necessary check (project-chip#36234)
1 parent 6ee1913 commit 019dcc7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

examples/dishwasher-app/silabs/src/ElectricalSensorManager.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,12 @@ void ElectricalSensorManager::UpdateEPMAttributes(OperationalStateEnum state)
196196
{
197197
if (gEPMDelegate)
198198
{
199-
uint16_t updateState = to_underlying(state);
200-
uint16_t ERROR_STATE_INDEX = ArraySize(kAttributes) - 1;
199+
uint8_t updateState = to_underlying(state);
200+
201201
// Check state range
202-
if ((updateState < 0) || (updateState > ERROR_STATE_INDEX))
202+
if (updateState >= ArraySize(kAttributes))
203203
{
204-
updateState = ERROR_STATE_INDEX;
204+
updateState = ArraySize(kAttributes) - 1;
205205
}
206206

207207
ChipLogDetail(AppServer, "UpdateAllAttributes to Operational State : %d", updateState);

0 commit comments

Comments
 (0)