Skip to content

Commit

Permalink
record pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
msbarry committed Apr 10, 2024
1 parent a3d0f9e commit 026f3e4
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ public List<T> getIntersecting(Geometry geom) {
private List<T> postFilterContaining(Point point, List<?> items) {
List<T> result = new ArrayList<>(items.size());
for (Object item : items) {
if (item instanceof GeomWithData<?> value && value.poly.contains(point)) {
@SuppressWarnings("unchecked") T t = (T) value.data;
if (item instanceof GeomWithData<?>(var poly,var data) && poly.contains(point)) {
@SuppressWarnings("unchecked") T t = (T) data;
result.add(t);
}
}
Expand All @@ -78,8 +78,8 @@ private List<T> postFilterContaining(Point point, List<?> items) {
private List<T> postFilterIntersecting(Geometry geom, List<?> items) {
List<T> result = new ArrayList<>(items.size());
for (Object item : items) {
if (item instanceof GeomWithData<?> value && value.poly.intersects(geom)) {
@SuppressWarnings("unchecked") T t = (T) value.data;
if (item instanceof GeomWithData<?>(var poly,var data) && poly.intersects(geom)) {
@SuppressWarnings("unchecked") T t = (T) data;
result.add(t);
}
}
Expand Down

0 comments on commit 026f3e4

Please sign in to comment.