From 29ff2b8f44061f0cca9cb264567444e96f8d031c Mon Sep 17 00:00:00 2001 From: armantorkzaban Date: Fri, 8 Jul 2022 18:20:56 +0200 Subject: [PATCH] refactors boolean_equal --- lib/src/booleans/boolean_equal.dart | 6 ------ test/booleans/equal_test.dart | 3 +-- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/lib/src/booleans/boolean_equal.dart b/lib/src/booleans/boolean_equal.dart index f461249..4f26bc7 100644 --- a/lib/src/booleans/boolean_equal.dart +++ b/lib/src/booleans/boolean_equal.dart @@ -29,12 +29,6 @@ bool booleanEqual( if (!(precision >= 0)) { throw Exception("precision must be a positive number"); } - var geom = feature1 is Feature ? feature1.geometry : feature1; - var geom2 = feature2 is Feature ? feature2.geometry : feature2; - - var type1 = geom!.type; - var type2 = geom2!.type; - if (type1 != type2) return false; var equality = Equality( precision: precision, diff --git a/test/booleans/equal_test.dart b/test/booleans/equal_test.dart index ad766a6..e6beb3f 100644 --- a/test/booleans/equal_test.dart +++ b/test/booleans/equal_test.dart @@ -7,7 +7,7 @@ import 'package:turf/src/booleans/boolean_equal.dart'; main() { group( - 'boolean_crosses', + 'boolean_equal', () { var inDir = Directory('./test/examples/booleans/equal/test/true'); for (var file in inDir.listSync(recursive: true)) { @@ -23,7 +23,6 @@ main() { var feature2 = inGeom.features[1]; Map json = jsonDecode(inSource); var options = json['properties']; - print(json['properties']?['direction']); var result = booleanEqual(feature1, feature2, precision: options?['precision'] ?? 6, shiftedPolygon: options?['shiftedPolygon'] ?? false,