Commit b0de5fa
Fix Credo 1.7.14 ExpensiveEmptyEnumCheck warnings
Replace expensive length/1 checks with Enum.empty?/1 in test files
to resolve Credo warnings introduced in version 1.7.14.
Changes:
- test/elixir/test/replication_test.exs: Replace length(list) > 0
- test/elixir/lib/couch/dbtest.ex: Replace length(list) > 0
- test/elixir/test/partition_size_limit_test.exs: Replace length(list) > 0
- test/elixir/test/basics_test.exs: Replace length(list) >= 1
These changes are semantically equivalent but more performant as
Enum.empty?/1 only checks for the first element instead of
traversing the entire list.
Fixes #57991 parent f7938ae commit b0de5fa
4 files changed
Lines changed: 4 additions & 4 deletions
File tree
- test/elixir
- lib/couch
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
199 | | - | |
| 199 | + | |
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
231 | | - | |
| 231 | + | |
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1671 | 1671 | | |
1672 | 1672 | | |
1673 | 1673 | | |
1674 | | - | |
| 1674 | + | |
1675 | 1675 | | |
1676 | 1676 | | |
1677 | 1677 | | |
| |||
0 commit comments