21 lines
471 B
Plaintext
21 lines
471 B
Plaintext
A conditional operator is sometimes cluttering readability, if one of the operand is a boolean literal it can be simplified in a boolean expression :
|
|
|
|
|
|
== Compliant Solution
|
|
|
|
----
|
|
boolean a = condition || exp;
|
|
boolean a = !condition && exp;
|
|
boolean a = !condition || exp;
|
|
boolean a = condition && exp;
|
|
----
|
|
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
include::comments-and-links.adoc[]
|
|
endif::env-github,rspecator-view[]
|