summaryrefslogtreecommitdiff
path: root/lib/Travel/Status/DE/HAFAS
diff options
context:
space:
mode:
authorDerf Null <derf@finalrewind.org>2023-04-18 22:34:53 +0200
committerDerf Null <derf@finalrewind.org>2023-04-18 22:35:06 +0200
commita163cb9ce310163d746879a029191ad60d5754cb (patch)
tree36f50638dd5827f8d9baff2b398c1fd6446b3bef /lib/Travel/Status/DE/HAFAS
parent5251adaa9d57b14032521495bb02871d9a532cb8 (diff)
Journey: Fix ->route_interesting
Broken by 4871bc50f636dca9030575b2d693079a5fd663d7
Diffstat (limited to 'lib/Travel/Status/DE/HAFAS')
-rw-r--r--lib/Travel/Status/DE/HAFAS/Journey.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Travel/Status/DE/HAFAS/Journey.pm b/lib/Travel/Status/DE/HAFAS/Journey.pm
index 824019b..1c862e3 100644
--- a/lib/Travel/Status/DE/HAFAS/Journey.pm
+++ b/lib/Travel/Status/DE/HAFAS/Journey.pm
@@ -9,6 +9,7 @@ use 5.014;
no if $] >= 5.018, warnings => 'experimental::smartmatch';
use parent 'Class::Accessor';
+use List::Util qw(any);
use Travel::Status::DE::HAFAS::Stop;
our $VERSION = '4.09';
@@ -392,7 +393,9 @@ sub route_interesting {
while ( @via_show < $max_parts and @via_main ) {
my $stop = shift(@via_main);
- if ( $stop ~~ \@via_show or $stop->{name} eq $last_stop->{name} ) {
+ if ( any { $_->{name} eq $stop->{name} } @via_show
+ or $stop->{name} eq $last_stop->{name} )
+ {
next;
}
push( @via_show, $stop );