Open vm06007 opened 1 year ago
Team would prefer to leave boolean comparison with == false
in this case, as it simplifies reading and less likely to be lost as comparison value. Oppose to using !
which can be accidentally deleted or removed or forgotten (it's not explicit or visible enough in our opinion to promote better readability of the contract)
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.
COR-01S: Literal Equality of
bool
VariableDescription:
The linked
bool
comparison is performed between a variable and abool
literal.Example:
Recommendation:
We advise the
bool
variable to be utilized directly either in its negated (!
) or original form.