Skip to content

Commit dcc99ea

Browse files
Copilotanidotnet
andcommitted
Address code review feedback - remove unused variables and redundant null check
Co-authored-by: anidotnet <[email protected]>
1 parent 02b08c3 commit dcc99ea

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

packages/nitrite_spatial/lib/src/filter.dart

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,7 @@ abstract class SpatialFilter extends IndexOnlyFilter {
4242
return false;
4343
}
4444

45-
if (documentGeometry == null) {
46-
return false;
47-
}
48-
49-
return applyGeometryFilter(documentGeometry);
45+
return applyGeometryFilter(documentGeometry!);
5046
}
5147

5248
/// Subclasses must implement this to define the specific spatial relationship check

packages/nitrite_spatial/test/intersects_false_positive_test.dart

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,7 @@ void main() {
4343
});
4444

4545
test('Test Intersects - Polygon and Point inside bounding box but outside geometry', () async {
46-
// Create a polygon and a point that is inside the bounding box
47-
// but outside the actual polygon
48-
var polygon = reader.read('POLYGON ((0 0, 10 0, 10 10, 0 10, 0 0))') as Polygon;
49-
var pointOutside = reader.read('POINT (15 15)') as Point; // Outside bounding box
50-
var pointInsideBBoxButOutsidePolygon = reader.read('POINT (12 5)') as Point; // Would be in bbox if expanded
51-
52-
// Actually, let's use a non-convex polygon to make this clearer
53-
// L-shaped polygon
46+
// Create a non-convex L-shaped polygon to test bbox vs geometry
5447
var lShapedPolygon = reader.read('POLYGON ((0 0, 10 0, 10 5, 5 5, 5 10, 0 10, 0 0))') as Polygon;
5548
var pointInBBoxButOutsidePolygon = reader.read('POINT (7 7)') as Point; // In bbox but outside L-shape
5649

0 commit comments

Comments
 (0)