Fix boolean expressions (#4099)

* Enable experimental check

* Remove experimental

* Don't compare Booleans using relational operators

* Fix boolean expressions
This commit is contained in:
chrchr-github 2022-05-10 20:42:24 +02:00 committed by GitHub
parent f23111d610
commit 759c16fcef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -6672,10 +6672,12 @@ bool Tokenizer::simplifyConditions()
result = (op1 == op2);
else if (cmp == "!=")
result = (op1 != op2);
else if (cmp == ">=" || cmp == "<=")
result = true;
else if (cmp == ">=")
result = (op1 || !op2);
else if (cmp == ">")
result = (op1 && !op2);
else if (cmp == "<=")
result = (!op1 || op2);
else if (cmp == "<")
result = (!op1 && op2);
else