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

Refactoring by swapping if-expr to avoid negation #79

Merged
merged 6 commits into from
Jun 23, 2022
Merged

Refactoring by swapping if-expr to avoid negation #79

merged 6 commits into from
Jun 23, 2022

Conversation

ThibFrgsGmz
Copy link
Contributor

@ThibFrgsGmz ThibFrgsGmz commented Jun 5, 2022

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

This PR aims at swapping some "if" and "else" branches of two if expression to remove a negation.

Misc:

  • remove two unneeded f-string format.
  • improve dict creation to be more concide and improve perf.

Rationale

Negative conditions are harder to read than positive conditions, so it is best to avoid them if possible. By swapping the if and else conditions, we can reverse the condition and make it positive.

Testing/Review Recommendations

void

Future Work

void

src/fprime/fbuild/cmake.py Outdated Show resolved Hide resolved
@ThibFrgsGmz ThibFrgsGmz requested a review from LeStarch June 8, 2022 19:53
@ThibFrgsGmz
Copy link
Contributor Author

@LeStarch Note: I've almost finished my first phase of refactoring fprime-tools.

I'm going to start to seriously work on the fprime one. I noticed that PRs take much longer to be accepted on the main repo.

Is there any particular reason? I have a lot of modification on the python autocoder so it's taking a lot longer.

@LeStarch
Copy link
Collaborator

Ahhh, I found the question! I answered in one of your PRs.

@LeStarch LeStarch merged commit 19718ed into nasa:devel Jun 23, 2022
@ThibFrgsGmz ThibFrgsGmz deleted the feat/swap-if-expression 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