Skip to content

Commit 936d442

Browse files
committed
Apply review feedback: improve ChronologicalGraphPath Javadoc
1 parent ba47e5f commit 936d442

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

application/src/main/java/org/opentripplanner/routing/graphfinder/ChronologicalGraphPath.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@
1414
* This utility encapsulates the direction-dependent ordering: for depart-after searches the chain
1515
* yields edges in reverse chronological order (newest first), while for arriveBy searches the chain
1616
* already yields edges in chronological order.
17+
* <p>
1718
* Implementation note: an earlier design relied on {@link org.opentripplanner.astar.model.GraphPath}
18-
* to extract the list of edges in chronological order / reverse chronological order.
19-
* The current implementation is optimized for reducing memory allocation.
19+
* which allocates a {@code LinkedList<State>} and, for depart-after searches, a full reversed copy
20+
* of the state chain via {@code State.reverse()}. This implementation avoids both by collecting
21+
* only the edges into a single {@code ArrayList} and reversing it in place.
2022
*/
2123
class ChronologicalGraphPath {
2224

0 commit comments

Comments
 (0)