Skip to content

Commit e8d0e29

Browse files
Apply suggestions from code review
Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>
1 parent 985477c commit e8d0e29

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

examples/all-clusters-app/all-clusters-common/src/energy-preference-delegate.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ EPrefDelegate::GetEnergyPriorityAtIndex(chip::EndpointId aEndpoint, size_t aInde
7979
{
8080
static EnergyPriorityEnum priorities[] = { EnergyPriorityEnum::kEfficiency, EnergyPriorityEnum::kComfort };
8181

82-
if (aIndex < (sizeof(priorities) / sizeof(priorities[0])))
82+
if (aIndex < ArraySize(priorities))
8383
{
8484
priority = priorities[aIndex];
8585
return CHIP_NO_ERROR;

src/app/clusters/energy-preference-server/energy-preference-server.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ struct Delegate
4747
*
4848
* @param aOutLabel The Label value from BalanceStruct. Storage is
4949
* provided by the caller, and is large enough to accomodate the
50-
* longest label (64 chars), on return the size of the span is
50+
* longest label (64 chars), on successful return the size of the span must be
5151
* adjusted to reflect the length of the value.
5252
*
5353
* @return CHIP_ERROR_NOT_FOUND if the index is out of range.
@@ -78,7 +78,7 @@ struct Delegate
7878
*
7979
* @param aOutLabel The Label value from BalanceStruct. Storage is
8080
* provided by the caller, and is large enough to accomodate the
81-
* longest label (64 chars), on return the size of the span is
81+
* longest label (64 chars), on successful return the size of the span must be
8282
* adjusted to reflect the length of the value.
8383
*
8484
* @return CHIP_ERROR_NOT_FOUND if the index is out of range.

0 commit comments

Comments
 (0)