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

Use prefix operators for increment/decrement #155

Merged
merged 3 commits into from
Oct 19, 2018

Conversation

jakirkham
Copy link
Member

For cases where iterators are in use, it's better to use prefix increment/decrement so the operation can happen in-place without making a copy of the iterator. Follow-up on a few other cases for style.

Prefix incrementing and decrementing don't incur a copying overhead to
keep the previous iterator around. So it is preferable to use prefix
operations when possible.
As `rank_point` is an iterator, it is preferable to use prefix
operations with it to avoid copying overhead associated with the postfix
operations. Hence this makes that change.
While these are all integers and are cheap (or free) to use with postfix
operators, prefer using prefix operators to match with general style.
@jakirkham jakirkham merged commit 2a923a6 into nanshe-org:master Oct 19, 2018
@jakirkham jakirkham deleted the use_prefix_inc_dec branch October 19, 2018 01:45
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.

1 participant