Skip to content

Commit 93d0f36

Browse files
committed
C#: Add ConstantConditionBad file.
1 parent 6820cba commit 93d0f36

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class Bad
2+
{
3+
public int Max(int a, int b)
4+
{
5+
return a > a ? a : b; // $ Alert
6+
}
7+
}

csharp/ql/test/query-tests/Bad Practices/Control-Flow/ConstantCondition/ConstantIfCondition.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@ public void Foo()
2525
}
2626
}
2727

28-
public int Max(int a, int b)
29-
{
30-
return a > a ? a : b; // $ Alert
31-
}
32-
3328
public int Bar()
3429
{
3530
return ZERO;

0 commit comments

Comments
 (0)