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

Expression simplified #5

Closed
wants to merge 4 commits into from
Closed

Expression simplified #5

wants to merge 4 commits into from

Conversation

AiXanadu
Copy link

Simplify expressions to make them easier to read.

@rickmark
Copy link
Contributor

Reject - first commits not squashed
second the expressions are not equivalent

!(value > 0) is not the same as value == 0

@AiXanadu
Copy link
Author

I don't quite understand that it is not equivalent when the value of (size_t size) is.

@nikias
Copy link
Member

nikias commented Nov 25, 2021

From a compiler perspective @rickmark is correct, but in the end this shall prevent the size being passed to be <= 0. Now since the type is size_t it will not be considered < 0 anyway, so a check for == 0 is sufficient here.

@AiXanadu
Copy link
Author

Maybe I didn't see your preparation for the future code.
I saw size_t, so I modified it to look more intuitive.
If you think there is something wrong with my modification, I can close it.

@AiXanadu AiXanadu closed this Nov 25, 2021
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