mirror of
https://github.com/github/codeql.git
synced 2026-04-12 02:24:00 +02:00
Rust: Fix performance issue with File.fromSource.
This commit is contained in:
@@ -45,13 +45,16 @@ extensible predicate additionalExternalFile(string relativePath);
|
||||
|
||||
/** A file. */
|
||||
class File extends Container, Impl::File {
|
||||
pragma[nomagic]
|
||||
private string getRelativePath0() { result = this.getRelativePath() }
|
||||
|
||||
/**
|
||||
* Holds if this file was extracted from the source code of the target project
|
||||
* (rather than another location such as inside a dependency).
|
||||
*/
|
||||
predicate fromSource() {
|
||||
exists(ExtractorStep s | s.getAction() = "Extract" and s.getFile() = this) and
|
||||
not additionalExternalFile(this.getRelativePath())
|
||||
not additionalExternalFile(this.getRelativePath0())
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user