Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 84ef4d7

Browse files
nivi-applebzbarsky-apple
andauthoredMay 31, 2024··
Apply suggestions from code review
Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>
1 parent 4dfad07 commit 84ef4d7

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed
 

‎src/darwin/Framework/CHIP/MTRDevice.mm

+3-4
Original file line numberDiff line numberDiff line change
@@ -3087,15 +3087,14 @@ - (void)_pruneClustersIn:(MTRDeviceDataValueDictionary)previousServerListValue
30873087
forEndpoint:(NSNumber *)endpointID
30883088
{
30893089
// If the server list changed and clusters were removed, remove those clusters from our data structures.
3090-
// Also remove it from the data store.
3090+
// Also remove them from the data store.
30913091
NSMutableSet<NSNumber *> * toBeRemovedClusters = [NSMutableSet setWithArray:[self arrayOfNumbersFromAttributeValue:previousServerListValue]];
30923092
NSSet<NSNumber *> * clustersStillOnEndpoint = [NSSet setWithArray:[self arrayOfNumbersFromAttributeValue:newServerListValue]];
30933093
[toBeRemovedClusters minusSet:clustersStillOnEndpoint];
30943094

30953095
NSMutableSet<MTRClusterPath *> * clusterPathsToRemove = [[NSMutableSet alloc] init];
3096-
for (NSNumber * cluster in toBeRemovedClusters) {
3097-
for (MTRClusterPath * path in _persistedClusters) {
3098-
if ([path.endpoint isEqualToNumber:endpointID] && [path.cluster isEqualToNumber:cluster]) {
3096+
for (MTRClusterPath * path in _persistedClusters) {
3097+
if ([path.endpoint isEqualToNumber:endpointID] && [toBeRemovedClusters containsObject:path.cluster])
30993098
[clusterPathsToRemove addObject:path];
31003099
}
31013100
}

0 commit comments

Comments
 (0)
Please sign in to comment.