Skip to content

Commit 82e17e8

Browse files
authored
Remove redundant abs call from Date.Range (#15669)
The preceding clauses handle steps that point away from the last date. Otherwise, `last_days - first_days` and `step` have the same sign, so `div/2` is already non-negative.
1 parent 17f782e commit 82e17e8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/elixir/lib/calendar/date_range.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ defmodule Date.Range do
185185
last_in_iso_days: last_days,
186186
step: step
187187
}),
188-
do: abs(div(last_days - first_days, step)) + 1
188+
do: div(last_days - first_days, step) + 1
189189

190190
# TODO: Remove me on v2.0
191191
defp size(

0 commit comments

Comments
 (0)