View Source Credo.Check.Warning.ExpensiveEmptyEnumCheck (Credo v1.7.5)
This check is enabled by default.
Learn how to disable it via
This check has a base priority of
high and works with any version of Elixir.
Checking if the size of the enum is
0 can be very expensive, since you are
determining the exact count of elements.
Checking if an enum is empty should be done by using
list == 
For Enum.count/2: Checking if an enum doesn't contain specific elements should be done by using
not Enum.any?(enum, condition)
There are no specific parameters for this check.
Like with all checks, general params can be applied.
Parameters can be configured via the
.credo.exs config file.