Skip to content

Commit 50c901d

Browse files
committed
C++: remove pointless predicate
1 parent 8da2f0b commit 50c901d

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

cpp/ql/src/semmle/code/cpp/exprs/Expr.qll

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,11 +1017,6 @@ class FoldExpr extends Expr, @foldexpr {
10171017
this.isBinaryFold() and
10181018
if this.isRightFold() then result = getChild(1) else result = getChild(0)
10191019
}
1020-
1021-
/**
1022-
* Holds if this is a binary fold with a child expression representing the initial value.
1023-
*/
1024-
predicate hasInitExpr() { exists(this.getInitExpr()) }
10251020
}
10261021

10271022
/**

cpp/ql/test/library-tests/fold/fold.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ import cpp
33
from FoldExpr fe, Expr pack, string init
44
where
55
pack = fe.getPackExpr() and
6-
if fe.hasInitExpr() then init = fe.getInitExpr().toString() else init = "<no init>"
6+
if exists(fe.getInitExpr()) then init = fe.getInitExpr().toString() else init = "<no init>"
77
select fe, fe.getOperatorString(), pack, init

0 commit comments

Comments
 (0)