Fix inefficient pattern: if-exists -> exists-or-not-exists

This commit is contained in:
Nora Dimitrijević
2025-05-14 15:36:45 +02:00
parent e9d5515c3b
commit 96bdfbf76b

View File

@@ -121,17 +121,16 @@ class PrintRegularAstNode extends PrintAstNode, TPrintRegularAstNode {
}
private int getSynthAstNodeIndex() {
if
exists(AstNode parent |
shouldPrintAstEdge(parent, _, astNode) and
synthChild(parent, _, astNode)
)
then
exists(AstNode parent |
shouldPrintAstEdge(parent, _, astNode) and
synthChild(parent, result, astNode)
)
else result = 0
exists(AstNode parent |
shouldPrintAstEdge(parent, _, astNode) and
synthChild(parent, result, astNode)
)
or
not exists(AstNode parent |
shouldPrintAstEdge(parent, _, astNode) and
synthChild(parent, _, astNode)
) and
result = 0
}
private int getSynthAstNodeIndexForSynthParent() {