mirror of
https://github.com/github/codeql.git
synced 2026-05-01 03:35:13 +02:00
Update csharp/ql/src/Bad Practices/Control-Flow/ConstantCondition.ql
Co-authored-by: Tom Hvitved <hvitved@github.com>
This commit is contained in:
@@ -119,14 +119,14 @@ class ConstantMatchingCondition extends ConstantCondition {
|
||||
}
|
||||
|
||||
override predicate isWhiteListed() {
|
||||
exists(Switch se, Case c, int i | c = se.getCase(i) |
|
||||
c.getPattern() = this.(DiscardExpr) and
|
||||
(
|
||||
i > 0
|
||||
or
|
||||
i = 0 and
|
||||
exists(Expr cond | c.getCondition() = cond and not isConstantCondition(cond, true))
|
||||
)
|
||||
exists(Switch se, Case c, int i |
|
||||
c = se.getCase(i) and
|
||||
c.getPattern() = this.(DiscardExpr)
|
||||
|
|
||||
i > 0
|
||||
or
|
||||
i = 0 and
|
||||
exists(Expr cond | c.getCondition() = cond and not isConstantCondition(cond, true))
|
||||
)
|
||||
or
|
||||
this = any(PositionalPatternExpr ppe).getPattern(_)
|
||||
|
||||
Reference in New Issue
Block a user