27
27
#include < lib/support/SafeInt.h>
28
28
29
29
// Log error each time sync storage takes longer than this threshold
30
- #define SYNC_OPERATION_DURATION_LOG_THRESHOLD (2.0 )
30
+ #define SYNC_OPERATION_DURATION_LOG_THRESHOLD (2.0 )
31
31
32
32
// FIXME: Are these good key strings? https://github.com/project-chip/connectedhomeip/issues/28973
33
33
static NSString * sResumptionNodeListKey = @" caseResumptionNodeList" ;
@@ -137,7 +137,7 @@ - (nullable instancetype)initWithController:(MTRDeviceController *)controller
137
137
138
138
__block id resumptionNodeList;
139
139
__block NSArray <NSNumber *> * nodesWithAttributeInfo;
140
- NSDate *startTime = [NSDate now ];
140
+ NSDate * startTime = [NSDate now ];
141
141
dispatch_sync (_storageDelegateQueue, ^{
142
142
@autoreleasepool {
143
143
// NOTE: controller, not our weak ref, since we know it's still
@@ -185,7 +185,7 @@ - (void)fetchAttributeDataForAllDevices:(MTRDeviceControllerDataStoreClusterData
185
185
MTRDeviceController * controller = _controller;
186
186
VerifyOrReturn (controller != nil ); // No way to call delegate without controller.
187
187
188
- NSDate *startTime = [NSDate now ];
188
+ NSDate * startTime = [NSDate now ];
189
189
dispatch_sync (_storageDelegateQueue, ^{
190
190
if ([self ->_storageDelegate respondsToSelector: @selector (valuesForController:securityLevel:sharingType: )]) {
191
191
dataStoreSecureLocalValues = [self ->_storageDelegate valuesForController: controller securityLevel: MTRStorageSecurityLevelSecure sharingType: MTRStorageSharingTypeNotShared];
@@ -217,7 +217,7 @@ - (void)storeResumptionInfo:(MTRCASESessionResumptionInfo *)resumptionInfo
217
217
VerifyOrReturn (controller != nil ); // No way to call delegate without controller.
218
218
219
219
auto * oldInfo = [self findResumptionInfoByNodeID: resumptionInfo.nodeID];
220
- NSDate *startTime = [NSDate now ];
220
+ NSDate * startTime = [NSDate now ];
221
221
dispatch_sync (_storageDelegateQueue, ^{
222
222
if (oldInfo != nil ) {
223
223
// Remove old resumption id key. No need to do that for the
@@ -292,7 +292,7 @@ - (void)_clearResumptionInfoForNodeID:(NSNumber *)nodeID controller:(MTRDeviceCo
292
292
{
293
293
auto * oldInfo = [self findResumptionInfoByNodeID: nodeID];
294
294
if (oldInfo != nil ) {
295
- NSDate *startTime = [NSDate now ];
295
+ NSDate * startTime = [NSDate now ];
296
296
dispatch_sync (_storageDelegateQueue, ^{
297
297
[_storageDelegate controller: controller
298
298
removeValueForKey: ResumptionByResumptionIDKey (oldInfo.resumptionID)
@@ -307,7 +307,7 @@ - (void)_clearResumptionInfoForNodeID:(NSNumber *)nodeID controller:(MTRDeviceCo
307
307
if (syncDuration > SYNC_OPERATION_DURATION_LOG_THRESHOLD) {
308
308
MTR_LOG_ERROR (" MTRDeviceControllerDataStore _clearResumptionInfoForNodeID took %0.6lf seconds to remove from storage" , syncDuration);
309
309
}
310
- }
310
+ }
311
311
}
312
312
313
313
- (CHIP_ERROR)storeLastLocallyUsedNOC : (MTRCertificateTLVBytes)noc
@@ -316,7 +316,7 @@ - (CHIP_ERROR)storeLastLocallyUsedNOC:(MTRCertificateTLVBytes)noc
316
316
VerifyOrReturnError (controller != nil , CHIP_ERROR_PERSISTED_STORAGE_FAILED); // No way to call delegate without controller.
317
317
318
318
__block BOOL ok;
319
- NSDate *startTime = [NSDate now ];
319
+ NSDate * startTime = [NSDate now ];
320
320
dispatch_sync (_storageDelegateQueue, ^{
321
321
ok = [_storageDelegate controller: controller
322
322
storeValue: noc
@@ -337,7 +337,7 @@ - (MTRCertificateTLVBytes _Nullable)fetchLastLocallyUsedNOC
337
337
VerifyOrReturnValue (controller != nil , nil ); // No way to call delegate without controller.
338
338
339
339
__block id data;
340
- NSDate *startTime = [NSDate now ];
340
+ NSDate * startTime = [NSDate now ];
341
341
dispatch_sync (_storageDelegateQueue, ^{
342
342
@autoreleasepool {
343
343
data = [_storageDelegate controller: controller
@@ -373,7 +373,7 @@ - (nullable MTRCASESessionResumptionInfo *)_findResumptionInfoWithKey:(nullable
373
373
}
374
374
375
375
__block id resumptionInfo;
376
- NSDate *startTime = [NSDate now ];
376
+ NSDate * startTime = [NSDate now ];
377
377
dispatch_sync (_storageDelegateQueue, ^{
378
378
@autoreleasepool {
379
379
resumptionInfo = [_storageDelegate controller: controller
@@ -904,7 +904,7 @@ - (void)clearAllStoredClusterData
904
904
}
905
905
906
906
__block NSMutableDictionary <MTRClusterPath *, MTRDeviceClusterData *> * clusterDataToReturn = nil ;
907
- NSDate *startTime = [NSDate now ];
907
+ NSDate * startTime = [NSDate now ];
908
908
dispatch_sync (_storageDelegateQueue, ^{
909
909
std::lock_guard lock (self->_nodeArrayLock );
910
910
@@ -977,7 +977,7 @@ - (nullable MTRDeviceClusterData *)getStoredClusterDataForNodeID:(NSNumber *)nod
977
977
// when the consumer knows that we're supposed to have data for this cluster
978
978
// path.
979
979
__block MTRDeviceClusterData * clusterDataToReturn = nil ;
980
- NSDate *startTime = [NSDate now ];
980
+ NSDate * startTime = [NSDate now ];
981
981
dispatch_sync (_storageDelegateQueue, ^{
982
982
clusterDataToReturn = [self _fetchClusterDataForNodeID: nodeID endpointID: endpointID clusterID: clusterID];
983
983
});
@@ -1221,7 +1221,7 @@ - (NSString *)_deviceDataKeyForNodeID:(NSNumber *)nodeID
1221
1221
- (nullable NSDictionary <NSString *, id> *)getStoredDeviceDataForNodeID : (NSNumber *)nodeID
1222
1222
{
1223
1223
__block NSDictionary <NSString *, id > * deviceData = nil ;
1224
- NSDate *startTime = [NSDate now ];
1224
+ NSDate * startTime = [NSDate now ];
1225
1225
dispatch_sync (_storageDelegateQueue, ^{
1226
1226
MTRDeviceController * controller = self->_controller ;
1227
1227
VerifyOrReturn (controller != nil ); // No way to call delegate without controller.
0 commit comments