Skip to content

Commit c980863

Browse files
committedApr 19, 2024
Actually fix the review comment.
1 parent 1abc1e1 commit c980863

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed
 

‎src/app/ClusterStateCache.cpp

+15-16
Original file line numberDiff line numberDiff line change
@@ -462,28 +462,27 @@ void ClusterStateCacheT<CanEnableDataCaching>::OnEventData(const EventHeader & a
462462
mCallback.OnEventData(aEventHeader, apData ? &dataSnapshot : nullptr, apStatus);
463463
}
464464

465-
template <bool CanEnableDataCaching>
466-
CHIP_ERROR ClusterStateCacheT<CanEnableDataCaching>::GetStatus(const ConcreteAttributePath & path, StatusIB & status) const
465+
template <>
466+
CHIP_ERROR ClusterStateCacheT<true>::GetStatus(const ConcreteAttributePath & path, StatusIB & status) const
467467
{
468-
if constexpr (CanEnableDataCaching)
469-
{
470-
CHIP_ERROR err;
471-
472-
auto attributeState = GetAttributeState(path.mEndpointId, path.mClusterId, path.mAttributeId, err);
473-
ReturnErrorOnFailure(err);
468+
CHIP_ERROR err;
474469

475-
if (!attributeState->template Is<StatusIB>())
476-
{
477-
return CHIP_ERROR_INVALID_ARGUMENT;
478-
}
470+
auto attributeState = GetAttributeState(path.mEndpointId, path.mClusterId, path.mAttributeId, err);
471+
ReturnErrorOnFailure(err);
479472

480-
status = attributeState->template Get<StatusIB>();
481-
return CHIP_NO_ERROR;
482-
}
483-
else
473+
if (!attributeState->template Is<StatusIB>())
484474
{
485475
return CHIP_ERROR_INVALID_ARGUMENT;
486476
}
477+
478+
status = attributeState->template Get<StatusIB>();
479+
return CHIP_NO_ERROR;
480+
}
481+
482+
template <>
483+
CHIP_ERROR ClusterStateCacheT<false>::GetStatus(const ConcreteAttributePath & path, StatusIB & status) const
484+
{
485+
return CHIP_ERROR_INVALID_ARGUMENT;
487486
}
488487

489488
template <bool CanEnableDataCaching>

0 commit comments

Comments
 (0)