Skip to content

Commit

Permalink
Extract code from loop
Browse files Browse the repository at this point in the history
  • Loading branch information
CharliePoole committed Nov 28, 2024
1 parent bf59198 commit 40f826a
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ namespace NUnit.Engine.Services
{
public class ExtensionManager : IExtensionManager
{
static readonly Version CURRENT_ENGINE_VERSION = Assembly.GetExecutingAssembly().GetName().Version;

static readonly Logger log = InternalTrace.GetLogger(typeof(ExtensionManager));

private readonly IFileSystem _fileSystem;
Expand Down Expand Up @@ -472,9 +474,7 @@ internal void FindExtensionsInAssembly(ExtensionAssembly assembly)
string versionArg = extensionAttr.GetNamedArgument("EngineVersion") as string;
if (versionArg != null)
{
Assembly THIS_ASSEMBLY = Assembly.GetExecutingAssembly();
Version ENGINE_VERSION = THIS_ASSEMBLY.GetName().Version;
if (new Version(versionArg) > ENGINE_VERSION)
if (new Version(versionArg) > CURRENT_ENGINE_VERSION)
{
log.Warning($" Ignoring {extensionType.Name}. It requires version {versionArg}.");
continue;
Expand Down

0 comments on commit 40f826a

Please sign in to comment.