Skip to content

Commit b3f46d7

Browse files
committed
C++: isConstant() -> exists(getValue())
This code was clearly using `isConstant` as an indirect way of checking whether `getValue` would have a result. That's no longer valid, so I changed it to check `getValue` directly.
1 parent d81e6e9 commit b3f46d7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cpp/ql/src/Likely Bugs/Likely Typos/LogicalExprCouldBeSimplified.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ string comparisonOnLiterals(ComparisonOperation op) {
4343
simple(op.getLeftOperand()) and
4444
simple(op.getRightOperand()) and
4545
not op.getAnOperand().isInMacroExpansion() and
46-
if op.isConstant()
46+
if exists(op.getValue())
4747
then result = "This comparison involves two literals and is always " + op.getValue() + "."
4848
else result = "This comparison involves two literals and should be simplified."
4949
}

0 commit comments

Comments
 (0)