mirror of
https://github.com/github/codeql.git
synced 2026-04-22 15:25:18 +02:00
Eliminate duplicate predicate
This commit is contained in:
@@ -2,19 +2,12 @@
|
||||
|
||||
import java
|
||||
|
||||
/**
|
||||
* Gets the `i`th `SwitchCase` defined on `switch`, if one exists.
|
||||
*/
|
||||
SwitchCase getCase(StmtParent switch, int i) {
|
||||
result = switch.(SwitchExpr).getCase(i) or result = switch.(SwitchStmt).getCase(i)
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the `i`th `PatternCase` defined on `switch`, if one exists.
|
||||
*/
|
||||
PatternCase getPatternCase(StmtParent switch, int i) {
|
||||
result =
|
||||
rank[i + 1](PatternCase pc, int caseIdx | pc = getCase(switch, caseIdx) | pc order by caseIdx)
|
||||
rank[i + 1](PatternCase pc, int caseIdx | pc.isNthCaseOf(switch, caseIdx) | pc order by caseIdx)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user