mirror of
https://github.com/github/codeql.git
synced 2026-04-24 00:05:14 +02:00
Expose getFirstPatternCase, not getPatternCase/2
This commit is contained in:
@@ -478,9 +478,9 @@ private module ControlFlowGraphImpl {
|
||||
or
|
||||
result instanceof NullDefaultCase
|
||||
or
|
||||
not exists(getPatternCase(switch, _))
|
||||
not exists(getFirstPatternCase(switch))
|
||||
or
|
||||
result.getIndex() <= getPatternCase(switch, 0).getIndex()
|
||||
result.getIndex() <= getFirstPatternCase(switch).getIndex()
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -5,11 +5,18 @@ import java
|
||||
/**
|
||||
* Gets the `i`th `PatternCase` defined on `switch`, if one exists.
|
||||
*/
|
||||
PatternCase getPatternCase(StmtParent switch, int i) {
|
||||
private PatternCase getPatternCase(StmtParent switch, int i) {
|
||||
result =
|
||||
rank[i + 1](PatternCase pc, int caseIdx | pc.isNthCaseOf(switch, caseIdx) | pc order by caseIdx)
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the first `PatternCase` defined on `switch`, if one exists.
|
||||
*/
|
||||
PatternCase getFirstPatternCase(StmtParent switch) {
|
||||
result = getPatternCase(switch, 0)
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the PatternCase after pc, if one exists.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user