Skip to content

Commit 40464ed

Browse files
committed
Eliminate duplicate predicate
1 parent 3971817 commit 40464ed

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

java/ql/lib/semmle/code/java/controlflow/internal/SwitchCases.qll

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,12 @@
22

33
import java
44

5-
/**
6-
* Gets the `i`th `SwitchCase` defined on `switch`, if one exists.
7-
*/
8-
SwitchCase getCase(StmtParent switch, int i) {
9-
result = switch.(SwitchExpr).getCase(i) or result = switch.(SwitchStmt).getCase(i)
10-
}
11-
125
/**
136
* Gets the `i`th `PatternCase` defined on `switch`, if one exists.
147
*/
158
PatternCase getPatternCase(StmtParent switch, int i) {
169
result =
17-
rank[i + 1](PatternCase pc, int caseIdx | pc = getCase(switch, caseIdx) | pc order by caseIdx)
10+
rank[i + 1](PatternCase pc, int caseIdx | pc.isNthCaseOf(switch, caseIdx) | pc order by caseIdx)
1811
}
1912

2013
/**

0 commit comments

Comments
 (0)