diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Application.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Application.cs index d77aee4d25d..8782f369518 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Application.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Application.cs @@ -292,11 +292,7 @@ public static string ExecutablePath { get { - if (s_executablePath is null) - { - s_executablePath = Path.GetFullPath(PInvoke.GetModuleFileNameLongPath(default)); - } - + s_executablePath ??= Path.GetFullPath(PInvoke.GetModuleFileNameLongPath(default)); return s_executablePath; } } diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Control.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Control.cs index 741ebf7ab07..3963f522a47 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Control.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Control.cs @@ -12,7 +12,6 @@ using System.Runtime.ExceptionServices; using System.Runtime.InteropServices; using System.Runtime.InteropServices.ComTypes; -using System.Text; using System.Windows.Forms.Automation; using System.Windows.Forms.Layout; using Microsoft.Win32;