Skip to content

Commit

Permalink
simplify isEqualsNested
Browse files Browse the repository at this point in the history
  • Loading branch information
jakemac53 committed Oct 21, 2024
1 parent 88d1009 commit 294bc7b
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions pkgs/dart_model/lib/src/dart_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,7 @@ extension ModelExtension on Model {
// Checks if any merged map of `left` == any merged map of `right.
bool isEqualNested(Map<String, Object?> left, Map<String, Object?> right) {
if (left == right) return true;
if (left case final LazyMergedMapView merged) {
if (merged.expand.any((map) => isEqualNested(right, map))) {
return true;
}
}
if (right case final LazyMergedMapView merged) {
if (merged.expand.any((map) => isEqualNested(left, map))) {
return true;
}
}
return false;
return left.expand.any((l) => right.expand.contains(l));
}

while (true) {
Expand Down

0 comments on commit 294bc7b

Please sign in to comment.