mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
C++: Performance fix for existsCompleteWithName
This commit is contained in:
@@ -14,7 +14,12 @@ pragma[noinline]
|
||||
private predicate existsCompleteWithName(string name, @usertype d) {
|
||||
is_complete(d) and
|
||||
name = getTopLevelClassName(d) and
|
||||
strictcount(@usertype other | is_complete(other) and getTopLevelClassName(other) = name) = 1
|
||||
onlyOneCompleteClassExistsWithName(name)
|
||||
}
|
||||
|
||||
pragma[noinline]
|
||||
private predicate onlyOneCompleteClassExistsWithName(string name) {
|
||||
strictcount(@usertype c | is_complete(c) and getTopLevelClassName(c) = name) = 1
|
||||
}
|
||||
|
||||
/** Holds if `c` is an incomplete class named `name`. */
|
||||
|
||||
Reference in New Issue
Block a user