Skip to content

Commit

Permalink
fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
miklcct committed Oct 25, 2024
1 parent 372e4f0 commit 8753f82
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -219,15 +219,12 @@ private List<LineString> generateHopGeometriesFromOriginalTripPattern() {
// being replaced having a different number of stops. In that case the geometry will be
// preserved up until the first mismatching stop, and a straight line will be used for
// all segments after that.
int sizeOfShortestPattern = Math.min(
stopPattern.getSize(),
originalTripPattern.numberOfStops()
);

List<LineString> hopGeometries = new ArrayList<>();

for (int i = 0; i < sizeOfShortestPattern - 1; i++) {
LineString hopGeometry = originalTripPattern.getHopGeometry(i);
for (int i = 0; i < stopPattern.getSize() - 1; i++) {
LineString hopGeometry = i < originalTripPattern.numberOfStops() - 1
? originalTripPattern.getHopGeometry(i)
: null;

if (hopGeometry != null && stopPattern.sameStops(originalTripPattern.getStopPattern(), i)) {
// Copy hop geometry from previous pattern
Expand Down

0 comments on commit 8753f82

Please sign in to comment.