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 #9453

Conversation

f-alizada
Copy link
Contributor

@f-alizada f-alizada commented Nov 24, 2023

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

@f-alizada f-alizada marked this pull request as ready for review December 4, 2023 10:09
Copy link
Member

@JanKrivanek JanKrivanek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! ;-)

@f-alizada
Copy link
Contributor Author

Closing PR with to merge it to vs17.9: #9493

@f-alizada f-alizada closed this Dec 5, 2023
@f-alizada f-alizada deleted the f-alizada/exit-loop-after-found-parametername 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.

4 participants