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:
parent
32e0adb664
commit
0abcf540bb
2 changed files with 2 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue