Skip to content

Commit 7568868

Browse files
authored
Merge pull request github#14098 from hvitved/csharp/cil-best-impl
C#: Speedup `bestImplementation`
2 parents f5509da + 66f5e4a commit 7568868

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

csharp/ql/lib/semmle/code/cil/Stubs.qll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ private module Cached {
3232
exists(Assembly asm |
3333
asm = mi.getLocation() and
3434
(assemblyIsStubImpl(asm) implies asm.getFile().extractedQlTest()) and
35-
not exists(MethodImplementation better | mi.getMethod() = better.getMethod() |
36-
mi.getNumberOfInstructions() < better.getNumberOfInstructions()
37-
or
38-
mi.getNumberOfInstructions() = better.getNumberOfInstructions() and
39-
asm.getFile().toString() > better.getLocation().getFile().toString()
40-
) and
35+
mi =
36+
max(MethodImplementation impl |
37+
mi.getMethod() = impl.getMethod()
38+
|
39+
impl order by impl.getNumberOfInstructions(), impl.getLocation().getFile().toString() desc
40+
) and
4141
exists(mi.getAnInstruction())
4242
)
4343
}

0 commit comments

Comments
 (0)