Skip to content

Commit a440196

Browse files
committed
Use getAPattern
1 parent f347784 commit a440196

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

java/ql/lib/semmle/code/java/Statement.qll

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -559,9 +559,7 @@ class PatternCase extends SwitchCase {
559559
/**
560560
* Gets this case's sole pattern, if there is exactly one.
561561
*/
562-
PatternExpr getUniquePattern() {
563-
result = unique(PatternExpr pe | pe = this.getPatternAtIndex(_))
564-
}
562+
PatternExpr getUniquePattern() { result = unique(PatternExpr pe | pe = this.getAPattern()) }
565563

566564
/** Gets the guard applicable to this pattern case, if any. */
567565
Expr getGuard() { result.isNthChildOf(this, -3) }

0 commit comments

Comments
 (0)