Skip to content

Commit 02911c6

Browse files
author
Chan Tran
committed
refactor: use lambda
1 parent c4ab632 commit 02911c6

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

web-bundle/src/main/java/com/graphhopper/resources/BufferResource.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -178,14 +178,11 @@ private BufferFeature calculateSecondaryStartFeature(BufferFeature primaryStartF
178178
private List<Integer> queryBbox(BBox bbox, String roadName) {
179179
final List<Integer> filteredEdgesInBbox = new ArrayList<>();
180180

181-
this.locationIndex.query(bbox, new LocationIndex.Visitor() {
182-
@Override
183-
public void onEdge(int edgeId) {
184-
EdgeIteratorState state = graph.getEdgeIteratorState(edgeId, Integer.MIN_VALUE);
185-
List<String> queryRoadNames = getAllRouteNamesFromEdge(state);
186-
if (queryRoadNames.stream().anyMatch(x -> x.contains(roadName))) {
187-
filteredEdgesInBbox.add(edgeId);
188-
}
181+
this.locationIndex.query(bbox, edgeId -> {
182+
EdgeIteratorState state = graph.getEdgeIteratorState(edgeId, Integer.MIN_VALUE);
183+
List<String> queryRoadNames = getAllRouteNamesFromEdge(state);
184+
if (queryRoadNames.stream().anyMatch(x -> x.contains(roadName))) {
185+
filteredEdgesInBbox.add(edgeId);
189186
}
190187
});
191188

0 commit comments

Comments
 (0)