From 687bca88f38c9071bc36b86cbf1a31009691670a Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Sat, 2 Jan 2021 00:36:29 +0100 Subject: [PATCH] LoadedAssembly.GetPEFileOrNull(): avoid unnecessary throw+catch when called on bundles. This improves ILSpy performance when run inside the debugger. --- ILSpy/LoadedAssembly.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ILSpy/LoadedAssembly.cs b/ILSpy/LoadedAssembly.cs index 35296686a..7c4ddfee8 100644 --- a/ILSpy/LoadedAssembly.cs +++ b/ILSpy/LoadedAssembly.cs @@ -148,7 +148,8 @@ namespace ICSharpCode.ILSpy { try { - return GetPEFileAsync().GetAwaiter().GetResult(); + var loadResult = loadingTask.GetAwaiter().GetResult(); + return loadResult.PEFile; } catch (Exception ex) {