Unverified Commit ac9451dd authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

Properly fix Departure->route_interesting

parent 78cc52fe
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -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 );
		}
	}