File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
ruby/ql/src/queries/analysis Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -65,17 +65,19 @@ newtype DefLoc =
65
65
not exists ( MethodBase m | m .getAChild + ( ) = write )
66
66
}
67
67
68
+ pragma [ noinline]
69
+ ConstantWriteAccess definitionOf0 ( string fqn ) {
70
+ fqn = resolveConstant ( _) and
71
+ result =
72
+ min ( ConstantWriteAccess w | w .getQualifiedName ( ) = fqn | w order by w .getLocation ( ) .toString ( ) )
73
+ }
74
+
68
75
/**
69
76
* Gets the constant write that defines the given constant.
70
77
* Modules often don't have a unique definition, as they are opened multiple times in different
71
78
* files. In these cases we arbitrarily pick the definition with the lexicographically least
72
79
* location.
73
80
*/
74
81
ConstantWriteAccess definitionOf ( ConstantReadAccess r ) {
75
- result =
76
- min ( ConstantWriteAccess w |
77
- w .getQualifiedName ( ) = resolveConstant ( r )
78
- |
79
- w order by w .getLocation ( ) .toString ( )
80
- )
82
+ result = definitionOf0 ( resolveConstant ( r ) )
81
83
}
You can’t perform that action at this time.
0 commit comments