Skip to content

Commit 985e07d

Browse files
committed
pragma[nomagic] hasQualifiedName
These are cheap and frequently-used, and magicking them with respect to `interpretPackage` was yielding expensive, unnecessary regex operations.
1 parent 0129167 commit 985e07d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

go/ql/lib/semmle/go/Scopes.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ class Entity extends @object {
101101
* Note that for methods `pkg` is the package path followed by `.` followed
102102
* by the name of the receiver type, for example `io.Writer`.
103103
*/
104+
pragma[nomagic]
104105
predicate hasQualifiedName(string pkg, string name) {
105106
pkg = this.getPackage().getPath() and
106107
name = this.getName()
@@ -517,6 +518,7 @@ class Method extends Function {
517518
* `exists(Type t | t.hasQualifiedName(pkg, tp) and meth = t.getMethod(m))`: the latter
518519
* distinguishes between the method sets of `T` and `*T`, while the former does not.
519520
*/
521+
pragma[nomagic]
520522
predicate hasQualifiedName(string pkg, string tp, string m) {
521523
exists(NamedType t |
522524
this.isIn(t, m) and

0 commit comments

Comments
 (0)