Skip to content

Commit 62e418d

Browse files
committed
Rust: Proposed speedup 2.
1 parent 4e35bf3 commit 62e418d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

rust/ql/lib/codeql/files/FileSystem.qll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,17 @@ extensible predicate additionalExternalFile(string relativePath);
4646
/** A file. */
4747
class File extends Container, Impl::File {
4848
pragma[nomagic]
49-
private predicate fromSource0() {
50-
exists(ExtractorStep s | s.getAction() = "Extract" and s.getFile() = this)
49+
string getRelativePath0() {
50+
result = this.getRelativePath()
5151
}
5252

5353
/**
5454
* Holds if this file was extracted from the source code of the target project
5555
* (rather than another location such as inside a dependency).
5656
*/
5757
predicate fromSource() {
58-
this.fromSource0() and
59-
not additionalExternalFile(this.getRelativePath())
58+
exists(ExtractorStep s | s.getAction() = "Extract" and s.getFile() = this) and
59+
not additionalExternalFile(this.getRelativePath0())
6060
}
6161

6262
/**

0 commit comments

Comments
 (0)