From 0cb8f4b6237fe59549481864690120f4fbbf171a Mon Sep 17 00:00:00 2001 From: CptMoore <39010654+cptmoore@users.noreply.github.com> Date: Mon, 4 Mar 2024 02:03:42 +0100 Subject: [PATCH] Avoid spamming log with location error message. --- ModTekPreloader/Logging/AssemblyTracker.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ModTekPreloader/Logging/AssemblyTracker.cs b/ModTekPreloader/Logging/AssemblyTracker.cs index ebab11d..bd1b17a 100644 --- a/ModTekPreloader/Logging/AssemblyTracker.cs +++ b/ModTekPreloader/Logging/AssemblyTracker.cs @@ -41,17 +41,15 @@ private static void ProcessAssembly(Assembly assembly) return; } - if (s_assembliesLoaded.Contains(assembly)) + if (!s_assembliesLoaded.Add(assembly)) { return; } - s_assembliesLoaded.Add(assembly); - var locationOrName = AssemblyUtils.GetLocationOrName(assembly); File.AppendAllText(Paths.AssembliesLoadedLogPath, CSharpUtils.AsTextListLine(locationOrName)); - if (!Path.IsPathRooted(assembly.Location)) + if (assembly.IsDynamic || !Path.IsPathRooted(assembly.Location)) { return; }