Skip to content
This repository has been archived by the owner on Feb 28, 2024. It is now read-only.

Commit

Permalink
Replace if (Logger.IsDebugEnabled()) checks with closure usage
Browse files Browse the repository at this point in the history
  • Loading branch information
zkxs committed Mar 11, 2023
1 parent dabdeab commit e3fdb43
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions NeosModLoader/NeosVersionReset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,13 @@ internal static void Initialize()
.Where(IsPostXProcessed)
.ToArray();

if (Logger.IsDebugEnabled())
Logger.DebugFuncInternal(() =>
{
string potentialPlugins = postxedAssemblies
.Select(a => Path.GetFileName(a.Location))
.Join(delimiter: ", ");

Logger.DebugInternal($"Found {postxedAssemblies.Length} potential plugins: {potentialPlugins}");
}
return $"Found {postxedAssemblies.Length} potential plugins: {potentialPlugins}";
});

HashSet<Assembly> expectedPostXAssemblies = GetExpectedPostXAssemblies();

Expand All @@ -71,11 +70,12 @@ internal static void Initialize()
})
.ToArray();

if (Logger.IsDebugEnabled())

Logger.DebugFuncInternal(() =>
{
string actualPlugins = plugins.Keys.Join(delimiter: ", ");
Logger.DebugInternal($"Found {plugins.Count} actual plugins: {actualPlugins}");
}
return $"Found {plugins.Count} actual plugins: {actualPlugins}";
});

// warn about the assemblies we couldn't map to plugins
foreach (Assembly assembly in unmatchedAssemblies)
Expand Down

0 comments on commit e3fdb43

Please sign in to comment.