Skip to content

Commit 61ec80f

Browse files
committed
Improve performance
1 parent d0c3738 commit 61ec80f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

csharp/ql/lib/semmle/code/csharp/frameworks/microsoft/AspNetCore.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,8 @@ private predicate isPotentialMicrosoftAspNetCoreMvcController(Class controller)
220220
)
221221
}
222222

223+
bindingset[element]
224+
pragma[inline_late]
223225
private Compilation getACompilationFor(Element element) {
224226
result.getAFileCompiled() = element.getFile()
225227
}
@@ -351,7 +353,7 @@ private predicate isMicrosoftAspNetCoreMvcFallbackEndpointMapping(MethodCall cal
351353
private predicate hasMicrosoftAspNetCoreMvcEndpointMapping(Compilation application, Class controller) {
352354
isInMicrosoftAspNetCoreMvcApplication(controller, application) and
353355
exists(MethodCall mapping |
354-
application.getAFileCompiled() = mapping.getFile() and
356+
application = getACompilationFor(mapping) and
355357
(
356358
isMicrosoftAspNetCoreMvcConventionalEndpointMapping(mapping)
357359
or

0 commit comments

Comments
 (0)