Remove unnecessary check for the name parameter as parameter 1

This commit is contained in:
Joe Farebrother
2023-10-27 14:53:23 +01:00
parent 2416040854
commit ef15980bb6

View File

@@ -11,9 +11,9 @@ private class ViewCall extends MethodCall {
/** Gets the `name` argument to this call, if any. */
string getNameArgument() {
exists(StringLiteral lit, int i | i in [0 .. 1] |
this.getTarget().getParameter(i).getType() instanceof StringType and
DataFlow::localExprFlow(lit, this.getArgument(i)) and
exists(StringLiteral lit |
this.getTarget().getParameter(0).getType() instanceof StringType and
DataFlow::localExprFlow(lit, this.getArgument(0)) and
result = lit.getValue()
)
}