Skip to content

Commit

Permalink
objc: ignore metadata when comparing maps
Browse files Browse the repository at this point in the history
  • Loading branch information
asarhaddon committed Aug 27, 2024
1 parent 3b69e86 commit fc4d16d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions impls/objc/types.m
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,19 @@ BOOL equal_Q(NSObject * a, NSObject * b) {
return true;
} else if ([a isKindOfClass:[NSNumber class]]) {
return [(NSNumber *)a intValue] == [(NSNumber *)b intValue];
} else if ([a isKindOfClass:[NSDictionary class]]) {
// isEqual see differences in metadata.
NSDictionary * da = (NSDictionary *)a;
NSDictionary * db = (NSDictionary *)b;
if ([da count] != [db count]) {
return false;
}
for (key, value) in da {
if (db[key] != da) {
return false;
}
}
return true;
} else {
return [a isEqual:b];
}
Expand Down

0 comments on commit fc4d16d

Please sign in to comment.