File tree 1 file changed +3
-4
lines changed
src/darwin/Framework/CHIP
1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -3087,15 +3087,14 @@ - (void)_pruneClustersIn:(MTRDeviceDataValueDictionary)previousServerListValue
3087
3087
forEndpoint : (NSNumber *)endpointID
3088
3088
{
3089
3089
// 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.
3091
3091
NSMutableSet <NSNumber *> * toBeRemovedClusters = [NSMutableSet setWithArray: [self arrayOfNumbersFromAttributeValue: previousServerListValue]];
3092
3092
NSSet <NSNumber *> * clustersStillOnEndpoint = [NSSet setWithArray: [self arrayOfNumbersFromAttributeValue: newServerListValue]];
3093
3093
[toBeRemovedClusters minusSet: clustersStillOnEndpoint];
3094
3094
3095
3095
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])
3099
3098
[clusterPathsToRemove addObject: path];
3100
3099
}
3101
3100
}
You can’t perform that action at this time.
0 commit comments