File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Runtime Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -452,15 +452,17 @@ private int FindParameterIndexOfCompositeFormatStringSyntaxAttribute(ImmutableAr
452452 {
453453 for ( var i = 0 ; i < parameters . Length ; i ++ )
454454 {
455- ImmutableArray < AttributeData > attributes = parameters [ i ] . GetAttributes ( ) ;
456- for ( int j = 0 ; j < attributes . Length ; j ++ )
455+ if ( String . Equals ( parameters [ i ] . Type , SymbolEqualityComparer . Default ) )
457456 {
458- if ( StringSyntaxAttribute ! . Equals ( attributes [ j ] . AttributeClass ) )
457+ foreach ( AttributeData attribute in parameters [ i ] . GetAttributes ( ) )
459458 {
460- ImmutableArray < TypedConstant > arguments = attributes [ j ] . ConstructorArguments ;
461- if ( arguments . Length == 1 && CompositeFormat . Equals ( arguments [ 0 ] . Value ) )
459+ if ( StringSyntaxAttribute ! . Equals ( attribute . AttributeClass , SymbolEqualityComparer . Default ) )
462460 {
463- return i ;
461+ ImmutableArray < TypedConstant > arguments = attribute . ConstructorArguments ;
462+ if ( arguments . Length == 1 && CompositeFormat . Equals ( arguments [ 0 ] . Value ) )
463+ {
464+ return i ;
465+ }
464466 }
465467 }
466468 }
You can’t perform that action at this time.
0 commit comments