From 15c4717e599f1e529a54a4034bce720ac02cdb0c Mon Sep 17 00:00:00 2001 From: preciz Date: Fri, 24 Jul 2026 22:57:42 +0200 Subject: [PATCH] Remove redundant min from Enum.drop/2 The negative amount guard guarantees amount + count is always less than count. Assisted-by: Codex:GPT-5 --- lib/elixir/lib/enum.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/elixir/lib/enum.ex b/lib/elixir/lib/enum.ex index f5af8e5134..d9e326c1fc 100644 --- a/lib/elixir/lib/enum.ex +++ b/lib/elixir/lib/enum.ex @@ -903,7 +903,7 @@ defmodule Enum do def drop(enumerable, amount) when is_integer(amount) and amount < 0 do {count, fun} = slice_count_and_fun(enumerable, 1) - amount = Kernel.min(amount + count, count) + amount = amount + count if amount > 0 do fun.(0, amount, 1)