refactor: Replace length/1 with empty list comparison

Replace expensive length/1 calls with direct list comparison
to fix Credo warnings about performance
This commit is contained in:
Moritz 2026-01-20 15:58:15 +01:00 committed by Simon
parent a72896095a
commit c137ee6221
Signed by: simon
GPG key ID: 40E7A58C4AA1EDB2
2 changed files with 2 additions and 2 deletions

View file

@ -403,7 +403,7 @@ defmodule MvWeb.MemberLive.Form do
# Checks if form has any errors
defp has_form_errors?(form) do
case Map.get(form, :errors) do
errors when is_list(errors) and length(errors) > 0 -> true
errors when is_list(errors) and errors != [] -> true
_ -> false
end
end