Skip to content

Commit 3703a0d

Browse files
committed
fix: Simplify reject_timeless_predictions/1
1 parent ada3edd commit 3703a0d

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

lib/dotcom/schedule_finder/upcoming_departures.ex

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,7 @@ defmodule Dotcom.ScheduleFinder.UpcomingDepartures do
125125
end
126126

127127
defp reject_timeless_predictions(predictions) do
128-
predictions
129-
|> Enum.reject(fn
130-
%Prediction{arrival_time: nil, departure_time: nil} -> true
131-
_ -> false
132-
end)
128+
predictions |> Enum.reject(&(prediction_time(&1) == nil))
133129
end
134130

135131
def to_upcoming_departure(%{

0 commit comments

Comments
 (0)