From 7d118647e739756bc494918e7c9d24633748ba4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20Overg=C3=A5rd=20Nielsen?= Date: Tue, 16 Apr 2024 14:56:50 +0200 Subject: [PATCH] Simplify --- packages/realm_common/lib/src/realm_types.dart | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/packages/realm_common/lib/src/realm_types.dart b/packages/realm_common/lib/src/realm_types.dart index 543b85c6f..bc9304b67 100644 --- a/packages/realm_common/lib/src/realm_types.dart +++ b/packages/realm_common/lib/src/realm_types.dart @@ -280,19 +280,12 @@ class RealmValue { operator ==(Object other) { if (identical(this, other)) return true; final v = value; - if (other is RealmValue) { final ov = other.value; - if (identical(v, ov)) return true; - - if (v is Uint8List && ov is Uint8List) { - return memEquals(v, ov); - } - + if (v is Uint8List && ov is Uint8List) return memEquals(v, ov); // special case binary data return type == other.type && v == ov; } - - return v == other; + return v == other; // asymmetric comparison for convenience } @override