Skip to content

Commit 1359eb7

Browse files
authored
Merge branch 'master' into feature/app-install-flow-public
2 parents 00f7412 + 6cde0eb commit 1359eb7

File tree

3 files changed

+17
-34
lines changed

3 files changed

+17
-34
lines changed

src/darwin/Framework/CHIP/MTRBaseDevice.mm

+8-29
Original file line numberDiff line numberDiff line change
@@ -2290,12 +2290,8 @@ + (MTRAttributeRequestPath *)requestPathWithEndpointID:(NSNumber * _Nullable)end
22902290

22912291
- (BOOL)isEqualToAttributeRequestPath:(MTRAttributeRequestPath *)path
22922292
{
2293-
if (!path)
2294-
return NO;
2295-
2296-
return (path.endpoint && [_endpoint isEqualToNumber:path.endpoint])
2297-
&& (path.cluster && [_cluster isEqualToNumber:path.cluster])
2298-
&& (path.attribute && [_attribute isEqualToNumber:path.attribute]);
2293+
return [_endpoint isEqualToNumber:path.endpoint] && [_cluster isEqualToNumber:path.cluster] &&
2294+
[_attribute isEqualToNumber:path.attribute];
22992295
}
23002296

23012297
- (BOOL)isEqual:(id)object
@@ -2366,12 +2362,8 @@ + (MTREventRequestPath *)requestPathWithEndpointID:(NSNumber * _Nullable)endpoin
23662362

23672363
- (BOOL)isEqualToEventRequestPath:(MTREventRequestPath *)path
23682364
{
2369-
if (!path)
2370-
return NO;
2371-
2372-
return (path.endpoint && [_endpoint isEqualToNumber:path.endpoint])
2373-
&& (path.cluster && [_cluster isEqualToNumber:path.cluster])
2374-
&& (path.event && [_event isEqualToNumber:path.event]);
2365+
return
2366+
[_endpoint isEqualToNumber:path.endpoint] && [_cluster isEqualToNumber:path.cluster] && [_event isEqualToNumber:path.event];
23752367
}
23762368

23772369
- (BOOL)isEqual:(id)object
@@ -2440,11 +2432,7 @@ ConcreteClusterPath path(static_cast<chip::EndpointId>([endpointID unsignedShort
24402432

24412433
- (BOOL)isEqualToClusterPath:(MTRClusterPath *)clusterPath
24422434
{
2443-
if (!clusterPath)
2444-
return NO;
2445-
2446-
return (clusterPath.endpoint && [_endpoint isEqualToNumber:clusterPath.endpoint])
2447-
&& (clusterPath.cluster && [_cluster isEqualToNumber:clusterPath.cluster]);
2435+
return [_endpoint isEqualToNumber:clusterPath.endpoint] && [_cluster isEqualToNumber:clusterPath.cluster];
24482436
}
24492437

24502438
- (BOOL)isEqual:(id)object
@@ -2532,10 +2520,7 @@ ConcreteDataAttributePath path(static_cast<chip::EndpointId>([endpointID unsigne
25322520

25332521
- (BOOL)isEqualToAttributePath:(MTRAttributePath *)attributePath
25342522
{
2535-
if (!attributePath)
2536-
return NO;
2537-
2538-
return [self isEqualToClusterPath:attributePath] && attributePath.attribute && [_attribute isEqualToNumber:attributePath.attribute];
2523+
return [self isEqualToClusterPath:attributePath] && [_attribute isEqualToNumber:attributePath.attribute];
25392524
}
25402525

25412526
- (BOOL)isEqual:(id)object
@@ -2628,10 +2613,7 @@ ConcreteEventPath path(static_cast<chip::EndpointId>([endpointID unsignedShortVa
26282613

26292614
- (BOOL)isEqualToEventPath:(MTREventPath *)eventPath
26302615
{
2631-
if (!eventPath)
2632-
return NO;
2633-
2634-
return [self isEqualToClusterPath:eventPath] && eventPath.event && [_event isEqualToNumber:eventPath.event];
2616+
return [self isEqualToClusterPath:eventPath] && [_event isEqualToNumber:eventPath.event];
26352617
}
26362618

26372619
- (BOOL)isEqual:(id)object
@@ -2721,10 +2703,7 @@ ConcreteCommandPath path(static_cast<chip::EndpointId>([endpointID unsignedShort
27212703

27222704
- (BOOL)isEqualToCommandPath:(MTRCommandPath *)commandPath
27232705
{
2724-
if (!commandPath)
2725-
return NO;
2726-
2727-
return [self isEqualToClusterPath:commandPath] && commandPath.command && [_command isEqualToNumber:commandPath.command];
2706+
return [self isEqualToClusterPath:commandPath] && [_command isEqualToNumber:commandPath.command];
27282707
}
27292708

27302709
- (BOOL)isEqual:(id)object

src/darwin/Framework/CHIP/MTRDemuxingStorage.mm

+8
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ static bool IsMemoryOnlyGlobalKey(NSString * key)
144144

145145
// We do not expect to see the "g/a/*" keys for attribute values.
146146

147+
// We do not expect to see the "g/sa/*" keys for attribute values.
148+
147149
// We do not expect to see the "g/bt" and "g/bt/*" keys for the binding
148150
// table.
149151

@@ -162,6 +164,9 @@ static bool IsMemoryOnlyGlobalKey(NSString * key)
162164
// We do not expect to see the "g/icd/cic" key; that's only used for an ICD
163165
// that sends check-in messages.
164166

167+
// We do not expect to see the "g/icdfl" key; that's only used by
168+
// DefaultICDClientStorage, which Matter.framework does not use.
169+
165170
return false;
166171
}
167172

@@ -215,6 +220,9 @@ static bool IsMemoryOnlyIndexSpecificKey(NSString * key)
215220

216221
// We do not expect to see the "e/*" scenes keys.
217222

223+
// We do not epect to see the "icdc" or "icdk" keys, since those are only
224+
// used by DefaultICDClientStorage, which Matter.framework does not use.
225+
218226
return false;
219227
}
220228

src/darwin/Framework/CHIP/MTRDevice.mm

+1-5
Original file line numberDiff line numberDiff line change
@@ -336,11 +336,7 @@ - (id)copyWithZone:(NSZone *)zone
336336

337337
- (BOOL)isEqualToClusterData:(MTRDeviceClusterData *)otherClusterData
338338
{
339-
if (!otherClusterData)
340-
return NO;
341-
342-
return (otherClusterData.dataVersion && [_dataVersion isEqual:otherClusterData.dataVersion])
343-
&& (otherClusterData.attributes && [_attributes isEqual:otherClusterData.attributes]);
339+
return [_dataVersion isEqual:otherClusterData.dataVersion] && [_attributes isEqual:otherClusterData.attributes];
344340
}
345341

346342
- (BOOL)isEqual:(id)object

0 commit comments

Comments
 (0)