Skip to content

Commit b66ddbb

Browse files
committed
Transit performance
1 parent d536028 commit b66ddbb

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

reader-gtfs/src/main/java/com/graphhopper/reader/gtfs/GraphExplorer.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,15 @@ public boolean tryAdvance(Consumer<? super EdgeIteratorState> action) {
8585
// time expanded network. Later departures are reached via
8686
// WAIT edges. Algorithmically not necessary, and does not
8787
// reduce total number of relaxed nodes, but takes stress
88-
// off the priority queue.
88+
// off the priority queue. Additionally, when only walking,
89+
// don't bother finding the enterEdge, because we are not going to enter.
8990
if (edgeType == GtfsStorage.EdgeType.ENTER_TIME_EXPANDED_NETWORK) {
90-
action.accept(findEnterEdge()); // fully consumes edgeIterator
91-
return true;
91+
if (walkOnly) {
92+
return false;
93+
} else {
94+
action.accept(findEnterEdge()); // fully consumes edgeIterator
95+
return true;
96+
}
9297
}
9398

9499
action.accept(edgeIterator);

0 commit comments

Comments
 (0)