From 54943f4f6ec0db570f8fe57fb28a5e3ea6472dc8 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 13 Jul 2011 16:03:00 +0200 Subject: DeutscheBahn/Result: route_interesting adjustment, add tests for it --- lib/Travel/Status/DE/DeutscheBahn/Result.pm | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/Travel/Status/DE/DeutscheBahn') diff --git a/lib/Travel/Status/DE/DeutscheBahn/Result.pm b/lib/Travel/Status/DE/DeutscheBahn/Result.pm index 79cf5d4..a474f8a 100644 --- a/lib/Travel/Status/DE/DeutscheBahn/Result.pm +++ b/lib/Travel/Status/DE/DeutscheBahn/Result.pm @@ -79,6 +79,10 @@ sub route_interesting { } $last_stop = pop(@via); + if ( @via_main and $via_main[-1] eq $last_stop ) { + pop(@via_main); + } + if ( @via_main and @via and $via[0] eq $via_main[0] ) { shift(@via_main); } -- cgit v1.2.3