Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsenko committed Apr 17, 2024
1 parent 8ba4b48 commit 7d11864
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions packages/realm_common/lib/src/realm_types.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7d11864

Please sign in to comment.