Skip to content

Commit

Permalink
Apply @bzbarsky-apple's 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
cliffamzn and bzbarsky-apple authored Jul 25, 2023
1 parent 138de15 commit 3e0a655
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,13 @@ enum class Fields : uint8_t
kProductIdentifierValue = 1,
};

class GenericType : protected app::Clusters::HepaFilterMonitoring::Structs::ReplacementProductStruct::Type
// A struct used during reads of the ReplacementProductList to store a single list instance we request
// from the application.
//
// Inherit from an auto-generated struct to pick up the implementation bits, but make
// it private inheritance so people can't accidentally use this struct where the other
// is expected.
class GenericType : private HepaFilterMonitoring::Structs::ReplacementProductStruct::Type
{
private:
ResourceMonitoring::ProductIdentifierTypeEnum productIdentifierType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ CHIP_ERROR Instance::ReadReplacableProductList(AttributeValueEncoder & aEncoder)
CHIP_ERROR err = CHIP_NO_ERROR;
if (HasFeature(ResourceMonitoring::Feature::kReplacementProductList))
{
ReplacementProductListManager * productListManagerInstance = Instance::GetReplacementProductListManagerInstance();
ReplacementProductListManager * productListManagerInstance = GetReplacementProductListManagerInstance();
if (nullptr == productListManagerInstance)
{
aEncoder.EncodeEmptyList();
Expand All @@ -262,7 +262,7 @@ CHIP_ERROR Instance::ReadReplacableProductList(AttributeValueEncoder & aEncoder)

productListManagerInstance->Reset();

err = aEncoder.EncodeList([&](const auto & encoder) -> CHIP_ERROR {
err = aEncoder.EncodeList([productListManagerInstance](const auto & encoder) -> CHIP_ERROR {
Attributes::GenericReplacementProductStruct::GenericType replacementProductStruct;
CHIP_ERROR iteratorError = CHIP_NO_ERROR;
while (CHIP_NO_ERROR == iteratorError)
Expand Down

0 comments on commit 3e0a655

Please sign in to comment.