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

navigator: Change multiple decisions to SWITCH statements #23065

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

muramura
Copy link
Contributor

Solved Problem

Comparing the same variable value to multiple decision values.

Solution

Change to SWITCH statement.

Changelog Entry

None

Alternatives

None

Test coverage

None

Context

None

// TODO: handle different frames
PX4_ERR("Frame type %i not supported", (int)temp_vertex_i.frame);
break;
goto loop_exit;
Copy link
Member

Choose a reason for hiding this comment

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

Can we please refrain from using goto the break statement was fine here in the if context, just keep the code as is if you ask me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@PetervdPerk-NXP san.
The break in the if statement exits the for statement.
A break in a switch statement exits from a switch statement.
Before the change, the GOTO statement was used because it is a break to exit from the for statement.

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.

None yet

2 participants