You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This code can and should be simplified to read as follows:
if (someCondition)
returnX;
if (otherCondition)
returnY;
returnZ;
Whether or not braces are used for single-line conditionals is a matter for a different style rule, but in any case, the second code block is easier to read, uses fewer conditional constructs, and makes it all the more obvious that returning "Z" is the fallback / default case if no preceding conditionals are matched.
The text was updated successfully, but these errors were encountered:
cbeams
added a commit
to ManfredKarrer/archived-bisq-core
that referenced
this issue
Jun 6, 2018
For example, in the following code, the
else if
andelse
clauses are redundant:This code can and should be simplified to read as follows:
Whether or not braces are used for single-line conditionals is a matter for a different style rule, but in any case, the second code block is easier to read, uses fewer conditional constructs, and makes it all the more obvious that returning "Z" is the fallback / default case if no preceding conditionals are matched.
The text was updated successfully, but these errors were encountered: