mirror of
https://github.com/github/codeql.git
synced 2026-04-29 02:35:15 +02:00
Improve complexity class of getASuccessorSwitchCase
This commit is contained in:
@@ -464,6 +464,14 @@ class SwitchCase extends Stmt, @case {
|
||||
this = any(SwitchStmt ss).getCase(result) or this = any(SwitchExpr se).getCase(result)
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if this is the `n`th case of switch block `parent`.
|
||||
*/
|
||||
pragma[nomagic]
|
||||
predicate isNthCaseOf(StmtParent parent, int n) {
|
||||
this.getCaseIndex() = n and this.getParent() = parent
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if this `case` is a switch labeled rule of the form `... -> ...`.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user