Skip to content

Commit bcdbf14

Browse files
authored
Merge pull request #21671 from geoffw0/neutralperf
Rust: Fix performance issue with additionalExternalFile
2 parents 7de8ce9 + e72c116 commit bcdbf14

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,16 @@ extensible predicate additionalExternalFile(string relativePath);
4545

4646
/** A file. */
4747
class File extends Container, Impl::File {
48+
pragma[nomagic]
49+
private predicate isAdditionalExternalFile() { additionalExternalFile(this.getRelativePath()) }
50+
4851
/**
4952
* Holds if this file was extracted from the source code of the target project
5053
* (rather than another location such as inside a dependency).
5154
*/
5255
predicate fromSource() {
5356
exists(ExtractorStep s | s.getAction() = "Extract" and s.getFile() = this) and
54-
not additionalExternalFile(this.getRelativePath())
57+
not this.isAdditionalExternalFile()
5558
}
5659

5760
/**

0 commit comments

Comments
 (0)