From f27b60c274a786c8f375c418331025223a40b92f Mon Sep 17 00:00:00 2001 From: Farhad Alizada Date: Fri, 24 Nov 2023 11:51:32 +0100 Subject: [PATCH] Exit the loop after finding the switch name in the map --- src/MSBuild/CommandLineSwitches.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/MSBuild/CommandLineSwitches.cs b/src/MSBuild/CommandLineSwitches.cs index 847da8ba276..d637ce0f40d 100644 --- a/src/MSBuild/CommandLineSwitches.cs +++ b/src/MSBuild/CommandLineSwitches.cs @@ -305,12 +305,12 @@ internal static bool IsParameterlessSwitch( { parameterlessSwitch = switchInfo.parameterlessSwitch; duplicateSwitchErrorMessage = switchInfo.duplicateSwitchErrorMessage; - break; + return true; } } } - return parameterlessSwitch != ParameterlessSwitch.Invalid; + return false; } /// @@ -362,12 +362,12 @@ internal static bool IsParameterizedSwitch( missingParametersErrorMessage = switchInfo.missingParametersErrorMessage; unquoteParameters = switchInfo.unquoteParameters; emptyParametersAllowed = switchInfo.emptyParametersAllowed; - break; + return true; } } } - return parameterizedSwitch != ParameterizedSwitch.Invalid; + return false; } ///