nasa / fprime-tools

F´ Python tooling and helpers.
https://github.com/nasa/fprime
Apache License 2.0
21 stars 39 forks source link

Refactoring by swapping if-expr to avoid negation #79

Closed ThibFrgsGmz closed 2 years ago

ThibFrgsGmz commented 2 years ago
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:

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

ThibFrgsGmz commented 2 years ago

@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 commented 2 years ago

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