Rule for checking we're not calling length(_) =:= 0 or length(_) > 0? #469
Closed
paulo-ferraz-oliveira
started this conversation in
Ideas
Replies: 2 comments 2 replies
-
Yeah. The robot-butt rule :) length(List) =:= 0,
1 =:= length(List),
0 < erlang:length(List),
case erlang:length(List) of
0 -> …;
_ -> …
end,
try length(something:that(returns, a, list)) of
X when X > 0 -> …
catch
…
end, |
Beta Was this translation helpful? Give feedback.
0 replies
-
I would 100% call this rule |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
This is an expensive operation and can most likely be avoided.
Beta Was this translation helpful? Give feedback.
All reactions