Skip to content

Commit 6fda428

Browse files
authored
Remove redundant min from Enum.drop/2 (#15671)
The negative amount guard guarantees amount + count is always less than count. Assisted-by: Codex:GPT-5
1 parent e303c78 commit 6fda428

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/elixir/lib/enum.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,7 @@ defmodule Enum do
903903

904904
def drop(enumerable, amount) when is_integer(amount) and amount < 0 do
905905
{count, fun} = slice_count_and_fun(enumerable, 1)
906-
amount = Kernel.min(amount + count, count)
906+
amount = amount + count
907907

908908
if amount > 0 do
909909
fun.(0, amount, 1)

0 commit comments

Comments
 (0)