C++: Make the two queries more alike.

This commit is contained in:
Geoffrey White
2020-10-20 17:46:47 +01:00
parent 4630c69950
commit 7db2b2ce37
2 changed files with 8 additions and 8 deletions

View File

@@ -15,12 +15,7 @@
import cpp
class Allocation extends FunctionCall {
Allocation() {
exists(string name |
this.getTarget().hasGlobalOrStdName(name) and
(name = "malloc" or name = "calloc" or name = "realloc")
)
}
Allocation() { this.getTarget().hasGlobalOrStdName(["malloc", "calloc", "realloc"]) }
private string getName() { this.getTarget().hasGlobalOrStdName(result) }