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 @@ -3089,15 +3089,14 @@ - (void)_pruneClustersIn:(MTRDeviceDataValueDictionary)previousServerListValue
3089
3089
forEndpoint : (NSNumber *)endpointID
3090
3090
{
3091
3091
// If the server list changed and clusters were removed, remove those clusters from our data structures.
3092
- // Also remove it from the data store.
3092
+ // Also remove them from the data store.
3093
3093
NSMutableSet <NSNumber *> * toBeRemovedClusters = [NSMutableSet setWithArray: [self arrayOfNumbersFromAttributeValue: previousServerListValue]];
3094
3094
NSSet <NSNumber *> * clustersStillOnEndpoint = [NSSet setWithArray: [self arrayOfNumbersFromAttributeValue: newServerListValue]];
3095
3095
[toBeRemovedClusters minusSet: clustersStillOnEndpoint];
3096
3096
3097
3097
NSMutableSet <MTRClusterPath *> * clusterPathsToRemove = [[NSMutableSet alloc ] init ];
3098
- for (NSNumber * cluster in toBeRemovedClusters) {
3099
- for (MTRClusterPath * path in _persistedClusters) {
3100
- if ([path.endpoint isEqualToNumber:endpointID] && [path.cluster isEqualToNumber:cluster]) {
3098
+ for (MTRClusterPath * path in _persistedClusters) {
3099
+ if ([path.endpoint isEqualToNumber: endpointID] && [toBeRemovedClusters containsObject: path.cluster])
3101
3100
[clusterPathsToRemove addObject: path];
3102
3101
}
3103
3102
}
You can’t perform that action at this time.
0 commit comments