Skip to content

Commit

Permalink
Remove unused branch in resolve_potential_gap
Browse files Browse the repository at this point in the history
  • Loading branch information
shaolang committed Nov 24, 2024
1 parent 833d72a commit 1f26401
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions lib/crontab/date_helper.ex
Original file line number Diff line number Diff line change
Expand Up @@ -331,13 +331,8 @@ defmodule Crontab.DateHelper do
candidate
end

def resolve_potential_gap(from_ts = %{std_offset: n}, candidate = %{std_offset: m}, amt, unit) do
naive_candidate = shift(DateTime.to_naive(from_ts), amt, unit)

def resolve_potential_gap(%{std_offset: n}, candidate = %{std_offset: m}, amt, _) do
cond do
naive_candidate == DateTime.to_naive(candidate) ->
candidate

# move backwards from ST to DS, -1 to keep same hour
m > n and amt < 0 ->
shift(candidate, -1, :hour)
Expand Down

0 comments on commit 1f26401

Please sign in to comment.