Remove files caching from CachedPluginLoadContext, make it forward the call instead

This commit is contained in:
aldelaro5 committed 2024-08-31 05:54:41 -04:00
1 parent 40643ffdef
commit 4597be006e
1 file changed
+1 -7
+1 -7
View File
@@ -15,7 +15,6 @@ internal class CachedPluginLoadContext : IPluginLoadContext, IDisposable
public IPluginLoadContext PluginLoadContext { get; }
private byte[] assemblyData;
private byte[] assemblySymbolsData;
private readonly Dictionary<string, byte[]> files = new();
public CachedPluginLoadContext(IPluginLoadContext pluginLoadContext)
{
@@ -36,18 +35,13 @@ internal class CachedPluginLoadContext : IPluginLoadContext, IDisposable
public byte[] GetFile(string relativePath)
{
if (!files.ContainsKey(relativePath))
{
files[relativePath] = PluginLoadContext.GetFile(relativePath);
}
return files[relativePath];
return PluginLoadContext.GetFile(relativePath);
}
public void Dispose()
{
assemblyData = null;
assemblySymbolsData = null;
files.Clear();
}
}