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

Inline variables returned immediately #82

Merged
merged 2 commits into from
Jun 6, 2022
Merged

Inline variables returned immediately #82

merged 2 commits into from
Jun 6, 2022

Conversation

ThibFrgsGmz
Copy link
Contributor

Originating Project/Creator
Affected Component
Affected Architectures(s)
Related Issue(s) void
Has Unit Tests (y/n) n
Builds Without Errors (y/n) Let CI run
Unit Tests Pass (y/n) Let CI run
Documentation Included (y/n) n

Change Description

The goal of this PR is to inline some variables to a return in case the declared variable is immediately returned.

Rationale

Intermediate variables can be useful if they are used later as a parameter or condition, and their name can provide context for what the variable represents.
If returned by a function, the function name is present to indicate the type of result.

I took the liberty of removing these intermediate variables because they don't really add value.

Returning the result directly reduces the mental load of reading the function by shortening the code and removing an unnecessary variable.

Testing/Review Recommendations

void

Future Work

void

@LeStarch LeStarch merged commit ccb8129 into nasa:devel Jun 6, 2022
@ThibFrgsGmz ThibFrgsGmz deleted the feat/inline-immediately-returned-variable branch July 20, 2022 21:28
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