From 1bfa77759d8e51e442321d9eb45e488147c8d006 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 5 Oct 2016 21:22:10 +0200 Subject: IRIS: shave off some additional miliseconds --- lib/Travel/Status/DE/IRIS.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Travel/Status/DE/IRIS.pm b/lib/Travel/Status/DE/IRIS.pm index 056fef4..5674d61 100644 --- a/lib/Travel/Status/DE/IRIS.pm +++ b/lib/Travel/Status/DE/IRIS.pm @@ -354,7 +354,9 @@ sub get_realtime { my $result = $self->{departure_by_id}{$id}; - if ( not $result ) { + # add_result will return nothing if no ./tl node is present. The ./tl + # check here is for optimization purposes. + if ( not $result and ( $s->findnodes('./tl') )[0] ) { $result = $self->add_result( $station, $s ); if ($result) { $result->set_unscheduled(1); -- cgit v1.2.3