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

Modernize initialization of local iterators, replacing IteratorType it; it = <expression> #4970

Conversation

N-Dekker
Copy link
Contributor

Using Notepad++, Replace in Files, doing:

    Find what: ^( [ ]+)([^ ][^=\r\n]*[Ii]terator[^=\r\n]*)([ ]+)(\w+[Ii]t);[\r\n]+\1\4\ =
    Replace with: $1$2$3$4 =
    Filters: itk*.* !+\test
    Directory: D:\src\ITK\Modules
    [v] Match case
    (*) Regular expression

- Follow-up to pull request InsightSoftwareConsortium#4964
commit 4926511
"STYLE: Replace `Pointer var; var = x` with `Pointer var = x`"
Small style improvement to the previous commit.

- Following pull request InsightSoftwareConsortium#3959
commit ef24b65
"STYLE: Construct local variables by passing arguments directly (part 2)",
11 March, 2023
@github-actions github-actions bot added type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots area:Filtering Issues affecting the Filtering module area:Segmentation Issues affecting the Segmentation module area:Numerics Issues affecting the Numerics module labels Nov 21, 2024
@N-Dekker N-Dekker marked this pull request as ready for review November 21, 2024 10:44
Copy link
Member

@hjmjohnson hjmjohnson left a comment

Choose a reason for hiding this comment

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

Example update PR would be nice for this too.

@hjmjohnson hjmjohnson merged commit c35278c into InsightSoftwareConsortium:master Nov 21, 2024
17 checks passed
@N-Dekker
Copy link
Contributor Author

Thanks for merging, @hjmjohnson

Example update PR would be nice for this too.

Did you encounter such cases in the Examples?

N-Dekker added a commit to N-Dekker/ITK that referenced this pull request Nov 21, 2024
Using Notepad++, Replace in Files, doing:

    Find what: ^( [ ]+)([^ ][^=\r\n]*)([ ]+)(\w+);[\r\n]+\1\4\ =
    Replace with: $1$2$3$4 =
    Filters: itk*.* !+\test
    Directory: D:\src\ITK\Modules
    [v] Match case
    (*) Regular expression

Excluded a few cases where the syntax `T var; var = x` appears intentional (in
ConceptChecking, ImageKmeansModelEstimator, MahalanobisDistanceThresholdImageFunction,
QuasiNewtonOptimizerv4Template, and VariableSizeMatrix).

- Following pull request InsightSoftwareConsortium#4970
commit 89b5bd0
"STYLE: Replace `Iterator it; it = x` with `Iterator it = x`"
and other similar commits for different types of variables.
N-Dekker added a commit to N-Dekker/ITK that referenced this pull request Nov 21, 2024
Using Notepad++, Replace in Files, doing:

    Find what: ^( [ ]+)([^ ][^=\r\n]*)([ ]+)(\w+);[\r\n]+\1\4\ =
    Replace with: $1$2$3$4 =
    Filters: itk*.* !+\test
    Directory: D:\src\ITK\Modules
    [v] Match case
    (*) Regular expression

Excluded a few cases where the syntax `T var; var = x` appears intentional (in
ConceptChecking, ImageKmeansModelEstimator, MahalanobisDistanceThresholdImageFunction,
QuasiNewtonOptimizerv4Template, and VariableSizeMatrix).

- Following pull request InsightSoftwareConsortium#4970
commit 89b5bd0
"STYLE: Replace `Iterator it; it = x` with `Iterator it = x`"
and other similar commits for different types of variables.
hjmjohnson pushed a commit that referenced this pull request Nov 22, 2024
Using Notepad++, Replace in Files, doing:

    Find what: ^( [ ]+)([^ ][^=\r\n]*)([ ]+)(\w+);[\r\n]+\1\4\ =
    Replace with: $1$2$3$4 =
    Filters: itk*.* !+\test
    Directory: D:\src\ITK\Modules
    [v] Match case
    (*) Regular expression

Excluded a few cases where the syntax `T var; var = x` appears intentional (in
ConceptChecking, ImageKmeansModelEstimator, MahalanobisDistanceThresholdImageFunction,
QuasiNewtonOptimizerv4Template, and VariableSizeMatrix).

- Following pull request #4970
commit 89b5bd0
"STYLE: Replace `Iterator it; it = x` with `Iterator it = x`"
and other similar commits for different types of variables.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:Filtering Issues affecting the Filtering module area:Numerics Issues affecting the Numerics module area:Segmentation Issues affecting the Segmentation module type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants