Skip to content

Commit 42f86a8

Browse files
Update csharp/ql/src/Bad Practices/Control-Flow/ConstantCondition.ql
Co-authored-by: Tom Hvitved <[email protected]>
1 parent 371a72e commit 42f86a8

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

csharp/ql/src/Bad Practices/Control-Flow/ConstantCondition.ql

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,14 @@ class ConstantMatchingCondition extends ConstantCondition {
119119
}
120120

121121
override predicate isWhiteListed() {
122-
exists(Switch se, Case c, int i | c = se.getCase(i) |
123-
c.getPattern() = this.(DiscardExpr) and
124-
(
125-
i > 0
126-
or
127-
i = 0 and
128-
exists(Expr cond | c.getCondition() = cond and not isConstantCondition(cond, true))
129-
)
122+
exists(Switch se, Case c, int i |
123+
c = se.getCase(i) and
124+
c.getPattern() = this.(DiscardExpr)
125+
|
126+
i > 0
127+
or
128+
i = 0 and
129+
exists(Expr cond | c.getCondition() = cond and not isConstantCondition(cond, true))
130130
)
131131
or
132132
this = any(PositionalPatternExpr ppe).getPattern(_)

0 commit comments

Comments
 (0)