Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions router_result.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,15 @@ static bool check_plan_invariants (plan_t *plan) {
for (i_leg = 0; i_leg < itin->n_legs; ++i_leg) {
leg_t *leg = itin->legs + i_leg;
if (i_leg % 2 == 0) {
if (leg->journey_pattern != WALK) fprintf(stderr, "even numbered leg %d has journey_pattern %d not WALK.\n", i_leg, leg->journey_pattern);
fail = true;
if (leg->journey_pattern != WALK) {
fprintf(stderr, "even numbered leg %d has journey_pattern %d not WALK.\n", i_leg, leg->journey_pattern);
fail = true;
}
} else {
if (leg->journey_pattern == WALK) fprintf(stderr, "odd numbered leg %d has journey_pattern WALK.\n", i_leg);
fail = true;
if (leg->journey_pattern == WALK) {
fprintf(stderr, "odd numbered leg %d has journey_pattern WALK.\n", i_leg);
fail = true;
}
}
if (leg->t1 < leg->t0) {
fprintf(stderr, "non-increasing times within leg %d: %d, %d\n", i_leg, leg->t0, leg->t1);
Expand Down Expand Up @@ -316,7 +320,7 @@ bool router_result_to_plan (plan_t *plan, router_t *router, router_request_t *re
plan->n_itineraries += 1;
itin += 1;
}
return check_plan_invariants (plan);
return !check_plan_invariants (plan);
}

/* After routing, call to convert the router state into a readable list of
Expand Down