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

Improve convert func from string_util #65

Merged
merged 1 commit into from
May 4, 2022
Merged

Improve convert func from string_util #65

merged 1 commit into from
May 4, 2022

Conversation

ThibFrgsGmz
Copy link
Contributor

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

Change Description

This PR includes the following changes into the convert() function from string-util.py:

1- Replaces conditional assignment to a variable with an if expression [ref]
2- Convert the final conditional into a guard clause [ref]
3- Inline immediately returned template variable [ref]

Rationale

Using a guard condition in this way does not indent the rest of the function. In general, the less indentation there is, the easier it is to understand the code.

Testing/Review Recommendations

(void)

Future Work

(void)

@LeStarch LeStarch merged commit d53e5aa into nasa:devel May 4, 2022
@ThibFrgsGmz ThibFrgsGmz deleted the feat/opti-string-util-convert branch July 20, 2022 21:29
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