Open vm06007 opened 1 year ago
Team would prefer to leave boolean comparison with == true
in this case, as it simplifies reading and less likely to be lost as comparison value. Oppose not using anything.
This also in our opinion makes it easier to work with the code if condition needs to be negated or flipped, we can simplify change false to true or other way around as oppose to adding or deleting !
sign in front of the expression making more vulnerable to accidental loss of the character and misinterpretation of the logic intended.
MHR-01S: Literal Equality of
bool
VariablesDescription:
The linked
bool
comparisons are performed between variables andbool
literals.Example:
Recommendation:
We advise each
bool
variable to be utilized directly either in its negated (!
) or original form.