20 lines
467 B
Plaintext
20 lines
467 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[]
|