File tree Expand file tree Collapse file tree
src/Meziantou.Analyzer.CodeFixers/Rules Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -75,11 +75,15 @@ private static async Task<Document> ReplaceWithAttributeIsDefined(Document docum
7575 else
7676 {
7777 // Check for GetCustomAttributes().Count() comparisons
78- var countInvocation = GetGetCustomAttributesCountInvocation ( binaryOperation . LeftOperand , out var countIsOnLeft ) ;
78+ var countInvocation = GetGetCustomAttributesCountInvocation ( binaryOperation . LeftOperand , out var foundOnLeft ) ;
79+ var countIsOnLeft = foundOnLeft ;
7980 if ( countInvocation is null )
8081 {
81- countInvocation = GetGetCustomAttributesCountInvocation ( binaryOperation . RightOperand , out var countIsOnRight ) ;
82- countIsOnLeft = ! countIsOnRight ; // If found on right, Count is not on left
82+ countInvocation = GetGetCustomAttributesCountInvocation ( binaryOperation . RightOperand , out var foundOnRight ) ;
83+ if ( foundOnRight )
84+ {
85+ countIsOnLeft = false ; // Count is on right side
86+ }
8387 }
8488
8589 if ( countInvocation is not null )
You can’t perform that action at this time.
0 commit comments