Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exit the loop after finding the switch name in the map #9493

Conversation

f-alizada
Copy link
Contributor

@f-alizada f-alizada commented Dec 5, 2023

origin PR: #9453

Context

The methods: IsParameterlessSwitch and IsParameterizedSwitch are desgined to identify if the switch is exist or not, iterates the switches map and assignes the found values to the output variables, however after finding the needed parameter (name comparison) it continues to search till the end of the map, which makes it unnecessary since the name is unique across the all presented switches

Changes Made

Exit the method as soon the parameter name is find and the values are assigned.

Testing

Existing tests should pass

@ghost
Copy link

ghost commented Dec 5, 2023

Hello! I noticed that you're targeting one of our servicing branches. Please consider updating the version.

@f-alizada f-alizada merged commit af0e3d0 into dotnet:vs17.9 Dec 5, 2023
8 checks passed
@f-alizada f-alizada deleted the f-alizada/switch-parameter-search-logic-update branch June 14, 2024 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants