summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2015-06-04 20:11:56 +0200
committerDaniel Friesel <derf@finalrewind.org>2015-06-04 20:11:56 +0200
commit0c92beaf6d81019eed8a1ce4dd2c1bb853a94645 (patch)
tree7e3927041dbb34060f00dafddb7f918289ab4b18
parentc56337cef1d3a4069fae48c1d90953f5194556e0 (diff)
Result: route_interesting: We're working with references here. whooooops.
-rw-r--r--lib/Travel/Status/DE/EFA/Result.pm14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/Travel/Status/DE/EFA/Result.pm b/lib/Travel/Status/DE/EFA/Result.pm
index e598ef8..ff581f0 100644
--- a/lib/Travel/Status/DE/EFA/Result.pm
+++ b/lib/Travel/Status/DE/EFA/Result.pm
@@ -51,20 +51,24 @@ sub route_interesting {
$max_parts //= 3;
for my $stop (@via) {
- if ( $stop =~ m{ Bf | Hbf | Flughafen | S $ }ox ) {
+ if (
+ $stop->{stop_suf} =~ m{ Bf | Hbf | Flughafen | Hauptbahnhof
+ | Krankenhaus | Klinik | (?: S $ ) }ox
+ )
+ {
push( @via_main, $stop );
}
}
$last_stop = pop(@via);
- if ( @via_main and $via_main[-1] eq $last_stop ) {
+ if ( @via_main and $via_main[-1] == $last_stop ) {
pop(@via_main);
}
- if ( @via and $via[-1] eq $last_stop ) {
+ if ( @via and $via[-1] == $last_stop ) {
pop(@via);
}
- if ( @via_main and @via and $via[0] eq $via_main[0] ) {
+ if ( @via_main and @via and $via[0] == $via_main[0] ) {
shift(@via_main);
}
@@ -81,7 +85,7 @@ sub route_interesting {
while ( @via_show < $max_parts and @via_main ) {
my $stop = shift(@via_main);
- if ( $stop ~~ \@via_show or $stop eq $last_stop ) {
+ if ( $stop ~~ \@via_show or $stop == $last_stop ) {
next;
}
push( @via_show, $stop );