From 822660a08ea8bc7a7fd49a72ec337d7968c03c01 Mon Sep 17 00:00:00 2001 From: Felix Date: Thu, 7 Sep 2023 13:34:35 +0200 Subject: [PATCH] call GetProject only once in AggregateComamndLineItemsForProject --- SmartCmdArgs/SmartCmdArgs.Shared/CmdArgsPackage.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/SmartCmdArgs/SmartCmdArgs.Shared/CmdArgsPackage.cs b/SmartCmdArgs/SmartCmdArgs.Shared/CmdArgsPackage.cs index 45525b6d..b2f9e4b3 100644 --- a/SmartCmdArgs/SmartCmdArgs.Shared/CmdArgsPackage.cs +++ b/SmartCmdArgs/SmartCmdArgs.Shared/CmdArgsPackage.cs @@ -380,12 +380,14 @@ private TResult AggregateComamndLineItemsForProject(IVsHierarchy projec if (projectCmd == null) return default; - string projConfig = project.GetProject()?.ConfigurationManager?.ActiveConfiguration?.ConfigurationName; - string projPlatform = project.GetProject()?.ConfigurationManager?.ActiveConfiguration?.PlatformName; + var projectObj = project.GetProject(); + + string projConfig = projectObj?.ConfigurationManager?.ActiveConfiguration?.ConfigurationName; + string projPlatform = projectObj?.ConfigurationManager?.ActiveConfiguration?.PlatformName; string activeLaunchProfile = null; if (project.IsCpsProject()) - activeLaunchProfile = CpsProjectSupport.GetActiveLaunchProfileName(project.GetProject()); + activeLaunchProfile = CpsProjectSupport.GetActiveLaunchProfileName(projectObj); TResult JoinContainer(CmdContainer con) {