From fc4d16da4cf2ae43e2f71105dd294b48c7f4fe6c Mon Sep 17 00:00:00 2001 From: Nicolas Boulenguez Date: Tue, 27 Aug 2024 12:25:25 +0200 Subject: [PATCH] objc: ignore metadata when comparing maps --- impls/objc/types.m | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/impls/objc/types.m b/impls/objc/types.m index 356c746223..58991999d5 100644 --- a/impls/objc/types.m +++ b/impls/objc/types.m @@ -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]; }