mirror of
https://github.com/github/codeql.git
synced 2026-01-11 05:30:24 +01:00
Will need subsequent PRs fixing up test failures (due to deprecated methods moving around), but other than that everything should be straight-forward.
15 lines
347 B
Plaintext
15 lines
347 B
Plaintext
import python
|
|
|
|
/*
|
|
* Parameters with defaults that are used as an optimization.
|
|
* E.g. def f(x, len=len): ...
|
|
* (In general, this kind of optimization is not recommended.)
|
|
*/
|
|
|
|
predicate optimizing_parameter(Parameter p) {
|
|
exists(string name, Name glob | p.getDefault() = glob |
|
|
glob.getId() = name and
|
|
p.asName().getId() = name
|
|
)
|
|
}
|