Skip to content

Commit d0f4518

Browse files
committed
Swift: cache some predicated.
1 parent a32b08f commit d0f4518

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class MethodDecl extends AbstractFunctionDecl {
2626
* Holds if this function is called `funcName` and its a member of a
2727
* class, struct, extension, enum or protocol call `typeName`.
2828
*/
29-
predicate hasQualifiedName(string typeName, string funcName) {
29+
cached predicate hasQualifiedName(string typeName, string funcName) {
3030
this.getName() = funcName and
3131
(
3232
exists(NominalTypeDecl c |

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class TypeDecl extends TypeDeclBase {
2626
* The name and full name of `A` is `A`. The name of `B` is `B`, but the
2727
* full name of `B` is `A.B`.
2828
*/
29-
string getFullName() {
29+
cached string getFullName() {
3030
not this.getEnclosingDecl() instanceof TypeDecl and
3131
result = this.getName()
3232
or

0 commit comments

Comments
 (0)