Skip to content

Conversation

@karurung
Copy link

I simplified the if, else logic to improve the code's clarity and maintainability.
I reduced nested conditions, so it will be more efficient.

I simplified the `if`, `else` logic to improve the code's clarity and maintainability.
Copy link
Member

@DHowett DHowett left a comment

Choose a reason for hiding this comment

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

Thanks! May I ask what compelled this change? We use this pattern (nested conditions) fairly often and usually for a reason... are you planning to address those as well?

@DHowett
Copy link
Member

DHowett commented Nov 25, 2024

In addition, you will need to run the code formatter and change the title of this pull request to explain succinctly what you are doing...

@karurung
Copy link
Author

Hi, I didn't make a big change.
I simplified the nested conditional to improve code readability. I think this change makes it easier to read.
I also made the condition for progress > 0 explicit, which makes more clear.

@karurung karurung changed the title Update TerminalApi.cpp Simplify nested condition and make progress > 0 condition explicit Nov 26, 2024
@lhecker
Copy link
Member

lhecker commented Nov 26, 2024

You need to fix the indentation of the code in order for this to be merged.
But even if you fixed it, I'd be personally against merging this, because this is mostly a small, subjective change. It can be argued that the previous code is more readable, because it clearly distinguishes between valid values of the parameter progress and the member _taskbarProgress.

@karurung
Copy link
Author

Thank you for give me a feedback!

@karurung karurung closed this Nov 26, 2024
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.

3 participants