mirror of
https://github.com/github/codeql.git
synced 2026-05-02 04:05:14 +02:00
C++: Remove omittable exists variables
This commit is contained in:
@@ -28,8 +28,8 @@ private newtype LibraryT =
|
||||
lib.getVersion() = version
|
||||
} or
|
||||
LibraryTExternalPackage(@external_package ep, string name, string version) {
|
||||
exists(string namespace, string package_name |
|
||||
external_packages(ep, namespace, package_name, version) and
|
||||
exists(string package_name |
|
||||
external_packages(ep, _, package_name, version) and
|
||||
name = package_name
|
||||
)
|
||||
}
|
||||
@@ -42,8 +42,8 @@ class Library extends LibraryT {
|
||||
string version;
|
||||
|
||||
Library() {
|
||||
exists(LibraryElement lib | this = LibraryTElement(lib, name, version)) or
|
||||
exists(@external_package ep | this = LibraryTExternalPackage(ep, name, version))
|
||||
this = LibraryTElement(_, name, version) or
|
||||
this = LibraryTExternalPackage(_, name, version)
|
||||
}
|
||||
|
||||
string getName() { result = name }
|
||||
|
||||
@@ -54,7 +54,7 @@ private PreprocessorDirective next(PreprocessorDirective ppd) {
|
||||
|
||||
private int level(PreprocessorDirective ppd) {
|
||||
relevantDirective(ppd, _, _) and
|
||||
not exists(PreprocessorDirective previous | ppd = next(previous)) and
|
||||
not ppd = next(_) and
|
||||
result = 0
|
||||
or
|
||||
exists(PreprocessorDirective previous |
|
||||
@@ -101,8 +101,8 @@ predicate headerGuard(PreprocessorDirective notdef, File f) {
|
||||
}
|
||||
|
||||
predicate headerGuardChild(PreprocessorDirective open) {
|
||||
exists(File f, PreprocessorDirective headerGuard |
|
||||
headerGuard(headerGuard, f) and
|
||||
exists(File f |
|
||||
headerGuard(_, f) and
|
||||
openWithDepth(1, f, open, _)
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user