Made list of attribute names local variable
This commit is contained in:
@@ -24,14 +24,6 @@ namespace Coverlet.Core.Instrumentation
|
||||
private readonly static Lazy<MethodInfo> _markExecutedMethodLoader = new Lazy<MethodInfo>(GetMarkExecutedMethod);
|
||||
private InstrumenterResult _result;
|
||||
|
||||
private static readonly string[] _excludeAttributeNames = new[]
|
||||
{
|
||||
nameof(ExcludeFromCoverageAttribute),
|
||||
"ExcludeFromCoverage",
|
||||
nameof(ExcludeFromCodeCoverageAttribute),
|
||||
"ExcludeFromCodeCoverage"
|
||||
};
|
||||
|
||||
public Instrumenter(string module, string identifier, string[] filters, string[] excludedFiles)
|
||||
{
|
||||
_module = module;
|
||||
@@ -278,8 +270,16 @@ namespace Coverlet.Core.Instrumentation
|
||||
|
||||
private static bool IsExcludeAttribute(CustomAttribute customAttribute)
|
||||
{
|
||||
var excludeAttributeNames = new[]
|
||||
{
|
||||
nameof(ExcludeFromCoverageAttribute),
|
||||
"ExcludeFromCoverage",
|
||||
nameof(ExcludeFromCodeCoverageAttribute),
|
||||
"ExcludeFromCodeCoverage"
|
||||
};
|
||||
|
||||
var attributeName = customAttribute.AttributeType.Name;
|
||||
return _excludeAttributeNames.Any(a => a.Equals(attributeName));
|
||||
return excludeAttributeNames.Any(a => a.Equals(attributeName));
|
||||
}
|
||||
|
||||
private static Mono.Cecil.Cil.MethodBody GetMethodBody(MethodDefinition method)
|
||||
|
||||
Reference in New Issue
Block a user