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

STYLE: Replace postfix by prefix increment in C++ for loops #381

Conversation

N-Dekker
Copy link
Collaborator

@N-Dekker N-Dekker commented May 20, 2022

Applied to the src directory, at the GNU bash prompt:

find . -exec perl -pi -w -e 's/(\s+for \(.*;.*); (\w+)\+\+\)/$1; ++$2)/g;' {} \;

Follow-up to ITK pull request InsightSoftwareConsortium/ITK#2505
commit InsightSoftwareConsortium/ITK@878fa6f
"STYLE: Replace postfix by prefix increment in for loops in Examples"

According to Herb Sutter, Andrei Alexandrescu - C++ Coding Standards:
101 Rules, Guidelines, and Best Practices: "Prefer the canonical form of
++ and --. Prefer calling the prefix forms"

Applied to the src directory, at the GNU bash prompt:

    find . -exec perl -pi -w -e 's/(\s+for \(.*;.*); (\w+)\+\+\)/$1; ++$2)/g;' {} \;

Follow-up to ITK pull request InsightSoftwareConsortium/ITK#2505
commit InsightSoftwareConsortium/ITK@878fa6f
"STYLE: Replace postfix by prefix increment in `for` loops in Examples"
@github-actions github-actions bot added area:Core Issues affecting the Core module area:Filtering Issues affecting the Filtering module area:IO Issues affecting the IO module area:Nonunit Issues affecting the Nonunit module area:Numerics Issues affecting the Numerics module area:Registration Issues affecting the Registration module area:Remotes Issues affecting the Remote module area:Segmentation Issues affecting the Segmentation module language:C++ Changes to C++ examples type:Style Style changes: no logic impact (indentation, comments, naming) labels May 20, 2022
@N-Dekker N-Dekker marked this pull request as ready for review May 21, 2022 07:54
Copy link
Member

@thewtex thewtex left a comment

Choose a reason for hiding this comment

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

🚀

@thewtex thewtex merged commit 2ac631b into InsightSoftwareConsortium:master May 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:Core Issues affecting the Core module area:Filtering Issues affecting the Filtering module area:IO Issues affecting the IO module area:Nonunit Issues affecting the Nonunit module area:Numerics Issues affecting the Numerics module area:Registration Issues affecting the Registration module area:Remotes Issues affecting the Remote module area:Segmentation Issues affecting the Segmentation module language:C++ Changes to C++ examples type:Style Style changes: no logic impact (indentation, comments, naming)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants