review: skip journeys with negative duration

This commit is contained in:
Daniel Friesel 2023-01-02 15:05:37 +01:00
parent 4c1ae6d045
commit cf7f993309
No known key found for this signature in database
GPG key ID: 100D5BFB5166E005

View file

@ -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 (