Skip to content

Commit fc65160

Browse files
committed
Swift: Simplify the implemention of MethodDecl.hasQualifiedName.
1 parent 2c28fae commit fc65160

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

swift/ql/lib/codeql/swift/elements/decl/MethodDecl.qll

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,9 @@ class MethodDecl extends AbstractFunctionDecl {
3232
cached
3333
predicate hasQualifiedName(string typeName, string funcName) {
3434
this.getName() = funcName and
35-
(
36-
exists(NominalTypeDecl c |
37-
c.getFullName() = typeName and
38-
c.getAMember() = this
39-
)
40-
or
41-
exists(ExtensionDecl e |
42-
e.getExtendedTypeDecl().getFullName() = typeName and
43-
e.getAMember() = this
44-
)
35+
exists(Decl d |
36+
d.asNominalTypeDecl().getFullName() = typeName and
37+
d.getAMember() = this
4538
)
4639
}
4740

0 commit comments

Comments
 (0)