mirror of
https://github.com/github/codeql.git
synced 2026-02-08 03:01:10 +01:00
Merge pull request #124 from github/erik-krogh/fix-step-performance
fix performance of the transitive step query
This commit is contained in:
@@ -79,10 +79,13 @@ class AstNode extends TAstNode {
|
||||
* Gets the predicate that contains this AST node.
|
||||
*/
|
||||
pragma[noinline]
|
||||
Predicate getEnclosingPredicate() {
|
||||
not this instanceof Predicate and
|
||||
toQL(result) = toQL(this).getParent+()
|
||||
}
|
||||
Predicate getEnclosingPredicate() { this = getANodeInPredicate(result) }
|
||||
}
|
||||
|
||||
private AstNode getANodeInPredicate(Predicate pred) {
|
||||
result = pred.getAChild(_)
|
||||
or
|
||||
result = getANodeInPredicate(pred).getAChild(_)
|
||||
}
|
||||
|
||||
/** A toplevel QL program, i.e. a file. */
|
||||
|
||||
Reference in New Issue
Block a user