Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Boris Zbarsky <[email protected]>
  • Loading branch information
lpbeliveau-silabs and bzbarsky-apple authored Jun 16, 2023
1 parent 475366b commit 9e3dbf9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/app/clusters/on-off-server/on-off-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ class DefaultOnOffSceneHandler : public scenes::DefaultSceneHandlerImpl
bool mState;
};

/// @brief Struct holding an array of EndpointStatePair, handles insertion , get and removal by EndpointID.
/// TODO: Implemente generic object to handle this boilerplate array manipulation
/// @brief Struct holding an array of EndpointStatePair. Handles insertion, get and removal by EndpointID.
/// TODO: Implement generic object to handle this boilerplate array manipulation
struct StatePairBuffer
{
bool IsEmpty() const { return (mPairCount == 0); }
Expand Down Expand Up @@ -132,7 +132,7 @@ class DefaultOnOffSceneHandler : public scenes::DefaultSceneHandlerImpl
VerifyOrReturnValue(CHIP_NO_ERROR == FindPair(endpoint, position), CHIP_NO_ERROR);

uint16_t nextPos = static_cast<uint16_t>(position + 1);
uint16_t moveNum = static_cast<uint16_t>(MAX_ENDPOINT_COUNT - nextPos);
uint16_t moveNum = static_cast<uint16_t>(mPairCount - nextPos);

// Compress array after removal, if the removed position is not the last
if (moveNum)
Expand Down Expand Up @@ -193,7 +193,7 @@ class DefaultOnOffSceneHandler : public scenes::DefaultSceneHandlerImpl
return CHIP_ERROR_READ_FAILED;
}

AttributeValuePair Pairs[scenableAttributeCount];
AttributeValuePair pairs[scenableAttributeCount];

Pairs[0].attributeID.SetValue(Attributes::OnOff::Id);
Pairs[0].attributeValue = currentValue;
Expand Down Expand Up @@ -225,7 +225,7 @@ class DefaultOnOffSceneHandler : public scenes::DefaultSceneHandlerImpl
auto pair_iterator = attributeValueList.begin();
while (pair_iterator.Next())
{
Scenes::Structs::AttributeValuePair::DecodableType decodePair = pair_iterator.GetValue();
auto & decodePair = pair_iterator.GetValue();
if (decodePair.attributeID.HasValue())
{
// If attribute ID was encoded, verify it is the proper ID for the OnOff attribute
Expand Down

0 comments on commit 9e3dbf9

Please sign in to comment.