Skip to content

Commit

Permalink
Address further review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ksperling-apple committed Jan 15, 2025
1 parent 6a1e38a commit c4c9340
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/controller/AutoCommissioner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ CHIP_ERROR AutoCommissioner::SetCommissioningParameters(const CommissioningParam
// We can't reallocate mExtraReadPaths yet as this would free the old buffer,
// and the caller might be passing a sub-span of the old paths.
decltype(mExtraReadPaths) oldReadPaths(std::move(mExtraReadPaths));
VerifyOrReturnError(mExtraReadPaths.Alloc(extraReadPaths.size()).Get() != nullptr, CHIP_ERROR_NO_MEMORY);
VerifyOrReturnError(mExtraReadPaths.Alloc(extraReadPaths.size()), CHIP_ERROR_NO_MEMORY);
memcpy(mExtraReadPaths.Get(), extraReadPaths.data(), extraReadPaths.size() * sizeof(ReadPath));
}

Expand Down
2 changes: 1 addition & 1 deletion src/darwin/Framework/CHIP/MTRDeviceType.mm
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ - (NSNumber *)id

- (NSString *)name
{
return const_cast<NSString *>(_meta->name);
return _meta->name;
}

- (BOOL)isUtility
Expand Down
1 change: 1 addition & 0 deletions src/darwin/Framework/CHIP/MTREndpointInfo.mm
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ + (BOOL)populateChildrenForEndpoints:(NSDictionary<NSNumber *, MTREndpointInfo *
NSArray<MTRDescriptorClusterDeviceTypeStruct *> * deviceTypeList = MTRDecodeAttributeValue(path, *cache, &err);
if (!deviceTypeList) {
MTR_LOG_ERROR("Ignoring invalid DeviceTypeList for endpoint %u: %" CHIP_ERROR_FORMAT, path.mEndpointId, err.Format());
// proceed with deviceTypeList == nil, equivalent to an empty list
}

NSMutableArray * deviceTypes = [[NSMutableArray alloc] initWithCapacity:deviceTypeList.count];
Expand Down

0 comments on commit c4c9340

Please sign in to comment.