diff options
author | Daniel Friesel <derf@finalrewind.org> | 2015-05-07 21:50:59 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2015-05-07 21:50:59 +0200 |
commit | 2e5e35d929a7aa977dbebc280b6081bf49ad8a31 (patch) | |
tree | 299c6953058483f00daa29e2e5415f07a8bb19da | |
parent | 578c436831c40c13c71d389ed875584a8a87283f (diff) |
index: @departures construction: code cleanup
-rw-r--r-- | index.pl | 18 |
1 files changed, 6 insertions, 12 deletions
@@ -449,10 +449,8 @@ sub handle_request { origin => $result->origin, platform => $platform, info => $info, - is_cancelled => $result->can('is_cancelled') - ? $result->is_cancelled - : undef, - messages => { + is_cancelled => $result->is_cancelled, + messages => { delay => [ map { { timestamp => $_->[0], text => $_->[1] } } $result->delay_messages @@ -466,18 +464,14 @@ sub handle_request { delay => $delay, additional_stops => [ $result->additional_stops ], canceled_stops => [ $result->canceled_stops ], - replaced_by => $result->can('replaced_by') - ? [ + replaced_by => [ map { $_->type . q{ } . $_->train_no } $result->replaced_by - ] - : [], - replacement_for => $result->can('replacement_for') - ? [ + ], + replacement_for => [ map { $_->type . q{ } . $_->train_no } $result->replacement_for - ] - : [], + ], } ); } |