Use getAPattern

This commit is contained in:
Chris Smowton
2024-03-25 16:13:35 +00:00
parent f347784ec2
commit a4401963f5

View File

@@ -559,9 +559,7 @@ class PatternCase extends SwitchCase {
/**
* Gets this case's sole pattern, if there is exactly one.
*/
PatternExpr getUniquePattern() {
result = unique(PatternExpr pe | pe = this.getPatternAtIndex(_))
}
PatternExpr getUniquePattern() { result = unique(PatternExpr pe | pe = this.getAPattern()) }
/** Gets the guard applicable to this pattern case, if any. */
Expr getGuard() { result.isNthChildOf(this, -3) }