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

chore: use ++ instead of += #5597

Closed
wants to merge 1 commit into from
Closed

chore: use ++ instead of += #5597

wants to merge 1 commit into from

Conversation

kehiy
Copy link
Contributor

@kehiy kehiy commented Jul 23, 2023

Summary

I used ++ instead of =+
they do the same thing but the ++ is more readable and more properly

@kehiy
Copy link
Contributor Author

kehiy commented Jul 23, 2023

@winder @algoanne
can you review please

@winder winder requested review from winder and a team July 23, 2023 16:55
@codecov
Copy link

codecov bot commented Jul 23, 2023

Codecov Report

Merging #5597 (43dd59a) into master (197bfb6) will increase coverage by 0.00%.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #5597   +/-   ##
=======================================
  Coverage   55.79%   55.80%           
=======================================
  Files         446      446           
  Lines       63490    63490           
=======================================
+ Hits        35424    35430    +6     
+ Misses      25695    25692    -3     
+ Partials     2371     2368    -3     

see 13 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@tzaffi tzaffi left a comment

Choose a reason for hiding this comment

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

Thanks @kehiy for your pull request.

Though in most contexts I agree that ++ is preferable to += 1 in this specific context of a simulation I disagree. For the case of generate.go I don't see an obvious reason why we'd want to skip a generation and add a number different than 1. However, in the case of generate_test.go it's already the case that sometimes we add numbers greater than 1 to intra so it's definitely clearer to use += 1 here. Summarizing, since this is a simulation and the amount we're advancing by is not a-priori 1, I think we should continue using the same style as before and not adopt ++.

@kehiy
Copy link
Contributor Author

kehiy commented Jul 24, 2023

@tzaffi yep, that makes sense.
I'm going to close this PR, thanks for reviewing.

@kehiy kehiy closed this Jul 24, 2023
@kehiy kehiy deleted the addition branch July 24, 2023 18:16
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