Skip to content

Commit

Permalink
Made list of attribute names local variable
Browse files Browse the repository at this point in the history
  • Loading branch information
derhally committed Jun 5, 2018
1 parent 0da09c4 commit 4e4fa2b
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/coverlet.core/Instrumentation/Instrumenter.cs
Expand Up @@ -24,14 +24,6 @@ internal class Instrumenter
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;
Expand Down Expand Up @@ -278,8 +270,16 @@ private static void ReplaceExceptionHandlerBoundary(ExceptionHandler handler, In

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)
Expand Down

0 comments on commit 4e4fa2b

Please sign in to comment.