Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address some review comments on Darwin controller data store. #29003

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/darwin/Framework/CHIP/MTRDeviceControllerDataStore.mm
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,7 @@ - (nullable instancetype)initWithController:(MTRDeviceController *)controller
return nil;
}
}
_nodesWithResumptionInfo = [NSMutableArray arrayWithCapacity:[resumptionNodeList count]];
[_nodesWithResumptionInfo addObjectsFromArray:resumptionNodeList];
_nodesWithResumptionInfo = [resumptionNodeList mutableCopy];
} else {
_nodesWithResumptionInfo = [[NSMutableArray alloc] init];
}
Expand Down Expand Up @@ -184,7 +183,7 @@ - (void)storeResumptionInfo:(MTRCASESessionResumptionInfo *)resumptionInfo
// Update our resumption info node list.
[_nodesWithResumptionInfo addObject:resumptionInfo.nodeID];
[_storageDelegate controller:_controller
storeValue:[NSArray arrayWithArray:_nodesWithResumptionInfo]
storeValue:[_nodesWithResumptionInfo copy]
forKey:sResumptionNodeListKey
securityLevel:MTRStorageSecurityLevelSecure
sharingType:MTRStorageSharingTypeNotShared];
Expand Down Expand Up @@ -349,6 +348,9 @@ - (void)encodeWithCoder:(NSCoder *)coder

NSSet<Class> * MTRDeviceControllerStorageClasses()
{
// This only needs to return the classes for toplevel things we are storing,
// plus NSNumber because some archivers use that internally to store
// information about what's being archived.
static NSSet * const sStorageClasses = [NSSet setWithArray:@[
[NSNumber class],
[NSData class],
Expand Down