From 4e35bf3168e5541a0448a84e5114cc22c7de8a04 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Mon, 9 Mar 2026 15:06:20 +0000 Subject: [PATCH] Rust: Proposed speedup. --- rust/ql/lib/codeql/files/FileSystem.qll | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rust/ql/lib/codeql/files/FileSystem.qll b/rust/ql/lib/codeql/files/FileSystem.qll index cfab33b9a440..a492dbdffa59 100644 --- a/rust/ql/lib/codeql/files/FileSystem.qll +++ b/rust/ql/lib/codeql/files/FileSystem.qll @@ -45,12 +45,17 @@ extensible predicate additionalExternalFile(string relativePath); /** A file. */ class File extends Container, Impl::File { + pragma[nomagic] + private predicate fromSource0() { + exists(ExtractorStep s | s.getAction() = "Extract" and s.getFile() = this) + } + /** * 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 + this.fromSource0() and not additionalExternalFile(this.getRelativePath()) }