Skip to content

Commit e72c116

Browse files
committed
Rust: Proposed improved solution.
1 parent 95681bf commit e72c116

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ extensible predicate additionalExternalFile(string relativePath);
4646
/** A file. */
4747
class File extends Container, Impl::File {
4848
pragma[nomagic]
49-
private string getRelativePath0() { result = this.getRelativePath() }
49+
private predicate isAdditionalExternalFile() { additionalExternalFile(this.getRelativePath()) }
5050

5151
/**
5252
* Holds if this file was extracted from the source code of the target project
5353
* (rather than another location such as inside a dependency).
5454
*/
5555
predicate fromSource() {
5656
exists(ExtractorStep s | s.getAction() = "Extract" and s.getFile() = this) and
57-
not additionalExternalFile(this.getRelativePath0())
57+
not this.isAdditionalExternalFile()
5858
}
5959

6060
/**

0 commit comments

Comments
 (0)