Credo.Check.Warning.ExpensiveEmptyEnumCheck (Credo v1.5.0) View Source

This check has a base priority of high and works with any version of Elixir.

Explanation

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

Enum.empty?(enum)

or

list == []

Configuration parameters

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.