Skip to content

Commit

Permalink
Minor update: avoid extra constructor on IsExistentAttributePath (#36130
Browse files Browse the repository at this point in the history
)
  • Loading branch information
andy31415 authored Oct 21, 2024
1 parent 8c31c3f commit db7c54a
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/app/InteractionModelEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1507,20 +1507,14 @@ bool InteractionModelEngine::IsExistentAttributePath(const ConcreteAttributePath
{
#if CHIP_CONFIG_USE_DATA_MODEL_INTERFACE
#if CHIP_CONFIG_USE_EMBER_DATA_MODEL

bool providerResult = GetDataModelProvider()
->GetAttributeInfo(ConcreteAttributePath(path.mEndpointId, path.mClusterId, path.mAttributeId))
.has_value();
bool providerResult = GetDataModelProvider()->GetAttributeInfo(path).has_value();

bool emberResult = emberAfContainsAttribute(path.mEndpointId, path.mClusterId, path.mAttributeId);

// Ensure that Provider interface and ember are IDENTICAL in attribute location (i.e. "check" mode)
VerifyOrDie(providerResult == emberResult);
#endif

return GetDataModelProvider()
->GetAttributeInfo(ConcreteAttributePath(path.mEndpointId, path.mClusterId, path.mAttributeId))
.has_value();
return GetDataModelProvider()->GetAttributeInfo(path).has_value();
#else
return emberAfContainsAttribute(path.mEndpointId, path.mClusterId, path.mAttributeId);
#endif
Expand Down

0 comments on commit db7c54a

Please sign in to comment.