summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/WebService/TFL/Bus/Response.pm1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/WebService/TFL/Bus/Response.pm b/lib/WebService/TFL/Bus/Response.pm
index 6cba172..0f811fc 100644
--- a/lib/WebService/TFL/Bus/Response.pm
+++ b/lib/WebService/TFL/Bus/Response.pm
@@ -14,6 +14,7 @@ sub new_from_response {
return $class->new({
predictions => [
+ sort { $a->expectedArrival <=> $b->expectedArrival }
map { WebService::TFL::Bus::Prediction->new_from_response($_) }
grep { $_->{'$type'} =~ /\bPrediction\b/ }
$response_data->@*