diff options
author | Daniel Friesel <derf@finalrewind.org> | 2015-05-28 12:34:58 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2015-05-28 12:34:58 +0200 |
commit | 0b73e67ef20ca8b4efdcec85148cf92b4358d0cc (patch) | |
tree | 208c1265bb858192900a9f384ff7a468692ef9ff | |
parent | ae9051b807ac8116583f4a1b2e3b3cea7218a74f (diff) |
json_route_diff: fix trailing additional/cancelled handling
-rw-r--r-- | index.pl | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -112,25 +112,27 @@ helper 'json_route_diff' => sub { $sched_idx++; } } - while ( $route_idx++ < $#route ) { + while ( $route_idx < $#route ) { push( @json_route, { - name => $route[ $route_idx++ ], + name => $route[ $route_idx ], isAdditional => 1, isCancelled => 0 } ); + $route_idx++; } - while ( $sched_idx++ < $#sched_route ) { + while ( $sched_idx < $#sched_route ) { push( @json_route, { - name => $route[ $route_idx++ ], + name => $sched_route[ $sched_idx ], isAdditional => 0, isCancelled => 1 } ); + $sched_idx++; } return @json_route; }; |