Skip to content

Commit f6a517c

Browse files
authored
Merge pull request github#6882 from MathiasVP/fix-unnecessary-exists
C++/Python: Remove unnecessary `exists`
2 parents 8b6baa2 + 8049d3f commit f6a517c

File tree

3 files changed

+1
-4
lines changed

3 files changed

+1
-4
lines changed

cpp/ql/lib/semmle/code/cpp/Type.qll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1650,7 +1650,6 @@ class RoutineType extends Type, @routinetype {
16501650
i = 0 and result = "" and not exists(this.getAParameterType())
16511651
or
16521652
(
1653-
exists(this.getParameterType(i)) and
16541653
if i < max(int j | exists(this.getParameterType(j)))
16551654
then
16561655
// Not the last one

python/ql/lib/semmle/python/PrintAst.qll

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ private newtype TPrintAstNode =
5252
TStmtListNode(StmtList list) {
5353
shouldPrint(list.getAnItem(), _) and
5454
not list = any(Module mod).getBody() and
55-
not forall(AstNode child | child = list.getAnItem() | isNotNeeded(child)) and
56-
exists(list.getAnItem())
55+
not forall(AstNode child | child = list.getAnItem() | isNotNeeded(child))
5756
} or
5857
TRegExpTermNode(RegExpTerm term) {
5958
exists(StrConst str | term.getRootTerm() = getParsedRegExp(str) and shouldPrint(str, _))

python/ql/lib/semmle/python/dataflow/new/internal/PrintNode.qll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ string prettyNode(DataFlow::Node node) {
5858
*/
5959
bindingset[node]
6060
string prettyNodeForInlineTest(DataFlow::Node node) {
61-
exists(node.asExpr()) and
6261
result = prettyExpr(node.asExpr())
6362
or
6463
exists(Expr e | e = node.(DataFlow::PostUpdateNode).getPreUpdateNode().asExpr() |

0 commit comments

Comments
 (0)