Skip to content

Commit

Permalink
Fix equality bug on FeatureCollection
Browse files Browse the repository at this point in the history
  • Loading branch information
jsiedentop committed Feb 25, 2024
1 parent 82c0b26 commit 6bbfe12
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/src/turf_equality_base.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,12 @@ class Equality {
return compare((g1 as Feature).geometry, (g2 as Feature).geometry) &&
g1.id == g2.id;
} else if (_compareTypes<FeatureCollection>(g1, g2)) {
for (var i = 0; i < (g1 as FeatureCollection).features.length; i++) {
if (!compare(g1.features[i], (g2 as FeatureCollection).features[i])) {
if ((g1 as FeatureCollection).features.length !=
(g2 as FeatureCollection).features.length) {
return false;
}
for (var i = 0; i < g1.features.length; i++) {
if (!compare(g1.features[i], g2.features[i])) {
return false;
}
}
Expand Down

0 comments on commit 6bbfe12

Please sign in to comment.