From 7f6b56e37b48d3b924aa38f639358e3c5667479a Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Thu, 18 Jul 2024 10:35:33 -0400 Subject: [PATCH] minor update to kick ci --- .../util/ember-compatibility-functions.cpp | 40 ++++--------------- 1 file changed, 8 insertions(+), 32 deletions(-) diff --git a/src/app/util/ember-compatibility-functions.cpp b/src/app/util/ember-compatibility-functions.cpp index 1b2e6ba1f9f72c..67d344eb05bdb8 100644 --- a/src/app/util/ember-compatibility-functions.cpp +++ b/src/app/util/ember-compatibility-functions.cpp @@ -455,14 +455,8 @@ CHIP_ERROR ReadSingleClusterData(const SubjectDescriptor & aSubjectDescriptor, b uint8_t dataLength = gEmberAttributeIOBufferSpan[0]; if (dataLength == 0xFF) { - if (isNullable) - { - ReturnErrorOnFailure(writer->PutNull(tag)); - } - else - { - return CHIP_ERROR_INCORRECT_STATE; - } + VerifyOrReturnError(isNullable, CHIP_ERROR_INCORRECT_STATE); + ReturnErrorOnFailure(writer->PutNull(tag)); } else { @@ -477,14 +471,8 @@ CHIP_ERROR ReadSingleClusterData(const SubjectDescriptor & aSubjectDescriptor, b memcpy(&dataLength, gEmberAttributeIOBufferSpan.data(), sizeof(dataLength)); if (dataLength == 0xFFFF) { - if (isNullable) - { - ReturnErrorOnFailure(writer->PutNull(tag)); - } - else - { - return CHIP_ERROR_INCORRECT_STATE; - } + VerifyOrReturnError(isNullable, CHIP_ERROR_INCORRECT_STATE); + ReturnErrorOnFailure(writer->PutNull(tag)); } else { @@ -498,14 +486,8 @@ CHIP_ERROR ReadSingleClusterData(const SubjectDescriptor & aSubjectDescriptor, b uint8_t dataLength = gEmberAttributeIOBufferSpan[0]; if (dataLength == 0xFF) { - if (isNullable) - { - ReturnErrorOnFailure(writer->PutNull(tag)); - } - else - { - return CHIP_ERROR_INCORRECT_STATE; - } + VerifyOrReturnError(isNullable, CHIP_ERROR_INCORRECT_STATE); + ReturnErrorOnFailure(writer->PutNull(tag)); } else { @@ -519,14 +501,8 @@ CHIP_ERROR ReadSingleClusterData(const SubjectDescriptor & aSubjectDescriptor, b memcpy(&dataLength, gEmberAttributeIOBufferSpan.data(), sizeof(dataLength)); if (dataLength == 0xFFFF) { - if (isNullable) - { - ReturnErrorOnFailure(writer->PutNull(tag)); - } - else - { - return CHIP_ERROR_INCORRECT_STATE; - } + VerifyOrReturnError(isNullable, CHIP_ERROR_INCORRECT_STATE); + ReturnErrorOnFailure(writer->PutNull(tag)); } else {