зеркало из https://github.com/github/codeql.git
Merge pull request #6882 from MathiasVP/fix-unnecessary-exists
C++/Python: Remove unnecessary `exists`
This commit is contained in:
Коммит
f6a517c998
|
@ -1650,7 +1650,6 @@ class RoutineType extends Type, @routinetype {
|
|||
i = 0 and result = "" and not exists(this.getAParameterType())
|
||||
or
|
||||
(
|
||||
exists(this.getParameterType(i)) and
|
||||
if i < max(int j | exists(this.getParameterType(j)))
|
||||
then
|
||||
// Not the last one
|
||||
|
|
|
@ -52,8 +52,7 @@ private newtype TPrintAstNode =
|
|||
TStmtListNode(StmtList list) {
|
||||
shouldPrint(list.getAnItem(), _) and
|
||||
not list = any(Module mod).getBody() and
|
||||
not forall(AstNode child | child = list.getAnItem() | isNotNeeded(child)) and
|
||||
exists(list.getAnItem())
|
||||
not forall(AstNode child | child = list.getAnItem() | isNotNeeded(child))
|
||||
} or
|
||||
TRegExpTermNode(RegExpTerm term) {
|
||||
exists(StrConst str | term.getRootTerm() = getParsedRegExp(str) and shouldPrint(str, _))
|
||||
|
|
|
@ -58,7 +58,6 @@ string prettyNode(DataFlow::Node node) {
|
|||
*/
|
||||
bindingset[node]
|
||||
string prettyNodeForInlineTest(DataFlow::Node node) {
|
||||
exists(node.asExpr()) and
|
||||
result = prettyExpr(node.asExpr())
|
||||
or
|
||||
exists(Expr e | e = node.(DataFlow::PostUpdateNode).getPreUpdateNode().asExpr() |
|
||||
|
|
Загрузка…
Ссылка в новой задаче