From ac9451dd8797eed28f5dc1841ffaa969a288327b Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Sun, 29 Sep 2024 13:19:26 +0200 Subject: Properly fix Departure->route_interesting --- lib/Travel/Status/DE/EFA/Departure.pm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'lib/Travel/Status/DE') diff --git a/lib/Travel/Status/DE/EFA/Departure.pm b/lib/Travel/Status/DE/EFA/Departure.pm index 8711c86..703b29c 100644 --- a/lib/Travel/Status/DE/EFA/Departure.pm +++ b/lib/Travel/Status/DE/EFA/Departure.pm @@ -5,6 +5,7 @@ use warnings; use 5.010; use DateTime; +use List::Util qw(any); use Travel::Status::DE::EFA::Stop; use parent 'Class::Accessor'; @@ -230,11 +231,11 @@ sub route_interesting { while ( @via_show < $max_parts and @via_main ) { my $stop = shift(@via_main); - - # FIXME cannot smartmatch $stop since it became an object - # if ( $stop ~~ \@via_show or $stop == $last_stop ) { - # next; - # } + if ( any { $_->name eq $stop->name } @via_show + or $stop->name eq $last_stop->name ) + { + next; + } push( @via_show, $stop ); } } -- cgit v1.2.3