Skip to content

Commit e996eae

Browse files
authored
Merge pull request #13036 from aschackmull/java/typeprefix-perf
Java: Minor perf fix for typePrefixContainsAux1.
2 parents 9ccc65d + 3b004b0 commit e996eae

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

java/ql/lib/semmle/code/java/Type.qll

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,14 +191,19 @@ private predicate typePrefixContains_ext_neq(ParameterizedPrefix pps, Parameteri
191191
)
192192
}
193193

194+
pragma[nomagic]
195+
private TTypeParam parameterizedPrefixWithWildcard(ParameterizedPrefix pps0, Wildcard s) {
196+
result = TTypeParam(pps0, s)
197+
}
198+
194199
pragma[nomagic]
195200
private predicate typePrefixContainsAux1(
196201
ParameterizedPrefix pps, ParameterizedPrefix ppt0, RefType s
197202
) {
198203
exists(ParameterizedPrefix pps0 |
199204
typePrefixContains(pps0, ppt0) and
200-
pps = TTypeParam(pps0, s) and
201-
s instanceof Wildcard // manual magic, implied by `typeArgumentContains(_, s, t, _)`
205+
// `s instanceof Wildcard` is manual magic, implied by `typeArgumentContains(_, s, t, _)`
206+
pps = parameterizedPrefixWithWildcard(pps0, s)
202207
)
203208
}
204209

0 commit comments

Comments
 (0)