Skip to content

Commit 9afda34

Browse files
committed
Address comments
1 parent 754bfdd commit 9afda34

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

ql/src/codeql_ruby/ast/internal/Module.qll

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -188,14 +188,12 @@ private class IncludeOrPrependCall extends MethodCall {
188188
* methods evaluate the block in the context of some other module/class instead of
189189
* the enclosing one.
190190
*/
191-
private ModuleBase enclosingModule(AstNode node) {
192-
exists(AstNode parent | parent = node.getParent() |
193-
result = parent
194-
or
195-
not parent instanceof ModuleBase and
196-
not parent instanceof Block and
197-
result = enclosingModule(parent)
198-
)
191+
private ModuleBase enclosingModule(AstNode node) { result = parent*(node).getParent() }
192+
193+
private AstNode parent(AstNode n) {
194+
result = n.getParent() and
195+
not result instanceof ModuleBase and
196+
not result instanceof Block
199197
}
200198

201199
private string prepends(string qname) {

0 commit comments

Comments
 (0)