未验证 提交 bd412637 编写于 作者: Y Youssef Victor 提交者: GitHub

Apply feedback

上级 60f516e5
......@@ -6,8 +6,8 @@
using System.Collections.Concurrent;
using System.Diagnostics;
using System.Linq;
using System.Threading;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CodeStyle;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.Operations;
......@@ -115,20 +115,9 @@ void OnSymbolEnd(SymbolAnalysisContext symbolEndContext)
symbol.Locations.Length == 1 &&
symbol.Type.IsMutableValueType() == false &&
!symbol.IsFixedSizeBuffer &&
!ContainsAttribute(symbol, threadStaticAttribute);
static bool ContainsAttribute(ISymbol symbol, INamedTypeSymbol attributeSymbol)
{
var attributes = symbol.GetAttributes();
foreach (var attribute in attributes)
{
if (SymbolEqualityComparer.Default.Equals(attribute.AttributeClass, attributeSymbol))
{
return true;
}
}
return false;
}
!symbol.GetAttributes().Any(
static (a, threadStaticAttribute) => SymbolEqualityComparer.Default.Equals(a.AttributeClass, threadStaticAttribute),
threadStaticAttribute);
// Method to update the field state for a candidate field written outside constructor and field initializer.
void UpdateFieldStateOnWrite(IFieldSymbol field)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册