File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed
Rubberduck.CodeAnalysis/Inspections/Concrete Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change 14
14
namespace Rubberduck . Inspections . Concrete
15
15
{
16
16
/// <summary>
17
- /// Identifies redundant Boolean expressions in conditionals .
17
+ /// Identifies conditional assignments to mutually exclusive Boolean literal values in conditional branches .
18
18
/// </summary>
19
19
/// <why>
20
- /// A Boolean expression never needs to be compared to a Boolean literal in a conditional expression.
20
+ /// The assignment could be made directly to the result of the conditional Boolean expression instead .
21
21
/// </why>
22
22
/// <example hasResults="true">
23
23
/// <![CDATA[
24
- /// Public Sub DoSomething(ByVal foo As Boolean)
25
- /// If foo = True Then ' foo is known to already be a Boolean value.
26
- /// ' ...
24
+ /// Public Sub DoSomething(ByVal value As Long)
25
+ /// Dim result As Boolean
26
+ /// If value > 10 Then
27
+ /// result = True
28
+ /// Else
29
+ /// result = False
27
30
/// End If
31
+ /// Debug.Print result
28
32
/// End Sub
29
33
/// ]]>
30
34
/// </example>
31
35
/// <example hasResults="false">
32
36
/// <![CDATA[
33
- /// Public Sub DoSomething(ByVal foo As Boolean )
34
- /// If foo Then
35
- /// ' ...
36
- /// End If
37
+ /// Public Sub DoSomething(ByVal value As Long )
38
+ /// Dim result As Boolean
39
+ /// result = value > 10
40
+ /// Debug.Print result
37
41
/// End Sub
38
42
/// ]]>
39
43
/// </example>
You can’t perform that action at this time.
0 commit comments