mirror of
https://github.com/github/codeql.git
synced 2026-05-01 03:35:13 +02:00
CPP: Speed up LeapYear.qll 'ChecksForLeapYearFunctionCall'.
This commit is contained in:
@@ -194,14 +194,21 @@ class StructTmLeapYearFieldAccess extends LeapYearFieldAccess {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* `Function` that includes an operation that is checking for leap year.
|
||||
*/
|
||||
class ChecksForLeapYearFunction extends Function {
|
||||
ChecksForLeapYearFunction() {
|
||||
this = any(CheckForLeapYearOperation clyo).getEnclosingFunction()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* `FunctionCall` that includes an operation that is checking for leap year.
|
||||
*/
|
||||
class ChecksForLeapYearFunctionCall extends FunctionCall {
|
||||
ChecksForLeapYearFunctionCall() {
|
||||
exists(Function f, CheckForLeapYearOperation clyo | f.getACallToThisFunction() = this |
|
||||
clyo.getEnclosingFunction() = f
|
||||
)
|
||||
this.getTarget() instanceof ChecksForLeapYearFunction
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user