summaryrefslogtreecommitdiff
path: root/lib/Travel/Status/DE
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-09-29 13:19:26 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2024-09-29 13:19:26 +0200
commitac9451dd8797eed28f5dc1841ffaa969a288327b (patch)
treedf1c53f3a0cc94eec8966f20c6c12523ae71bff4 /lib/Travel/Status/DE
parent78cc52fe2fdc06e0560cbe9d6e5e813d5a7d0beb (diff)
Properly fix Departure->route_interesting
Diffstat (limited to 'lib/Travel/Status/DE')
-rw-r--r--lib/Travel/Status/DE/EFA/Departure.pm11
1 files changed, 6 insertions, 5 deletions
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 );
}
}