From cf7f993309426604c67937f2363b9717fa1269f4 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 2 Jan 2023 15:05:37 +0100 Subject: review: skip journeys with negative duration --- lib/Travelynx/Model/Journeys.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/Travelynx') diff --git a/lib/Travelynx/Model/Journeys.pm b/lib/Travelynx/Model/Journeys.pm index f23c2b1..f577236 100755 --- a/lib/Travelynx/Model/Journeys.pm +++ b/lib/Travelynx/Model/Journeys.pm @@ -1088,7 +1088,7 @@ sub compute_review { my %seen; - if ( $journey->{rt_duration} ) { + if ( $journey->{rt_duration} and $journey->{rt_duration} > 0 ) { if ( not $longest_t or $journey->{rt_duration} > $longest_t->{rt_duration} ) { @@ -1163,7 +1163,7 @@ sub compute_review { } } - if ( $journey->{rt_duration} and $journey->{sched_duration} ) { + if ( $journey->{rt_duration} and $journey->{sched_duration} and $journey->{rt_duration} > 0 and $journey->{sched_duration} > 0 ) { my $slowdown = $journey->{rt_duration} - $journey->{sched_duration}; my $speedup = -$slowdown; if ( -- cgit v1.2.3