From 0c92beaf6d81019eed8a1ce4dd2c1bb853a94645 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 4 Jun 2015 20:11:56 +0200 Subject: Result: route_interesting: We're working with references here. whooooops. --- lib/Travel/Status/DE/EFA/Result.pm | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'lib/Travel') 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 ); -- cgit v1.2.3