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 Fill(0) on local variables with {} initialization #4897

Conversation

N-Dekker
Copy link
Contributor

Using Notepad++, Replace in Files, doing:

Find what: ^( [ ]+[^ ].* )(\w+);[\r\n]+ [ ]+\2\.Fill\(0\.?0?\);
Replace with: $1$2{};
Filters: itk*.cxx;itk*.hxx;itk*.h
Directory: D:\Src\ITK\Modules
[v] Match case
(*) Regular expression

Using Notepad++, Replace in Files, doing:

    Find what: ^( [ ]+[^ ].* )(\w+);[\r\n]+ [ ]+\2\.Fill\(0\.?0?\);
    Replace with: $1$2{};
    Filters: itk*.cxx;itk*.hxx;itk*.h
    Directory: D:\Src\ITK\Modules
    [v] Match case
    (*) Regular expression

Follow-up to pull request InsightSoftwareConsortium#4881
commit 569a8b6
"STYLE: Replace Fill(0) with {} initializer for local variables in tests"
@github-actions github-actions bot added type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct area:Core Issues affecting the Core module area:Filtering Issues affecting the Filtering module area:IO Issues affecting the IO module area:Registration Issues affecting the Registration module area:Segmentation Issues affecting the Segmentation module type:Style Style changes: no logic impact (indentation, comments, naming) area:Numerics Issues affecting the Numerics module labels Oct 24, 2024
@N-Dekker N-Dekker marked this pull request as ready for review October 24, 2024 16:17
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 0214928 into InsightSoftwareConsortium:master Oct 24, 2024
13 checks passed
N-Dekker added a commit to N-Dekker/ITK that referenced this pull request Oct 25, 2024
Using Notepad++, Replace in Files, doing:

    Find what: ^( [ ]+[^ ].* )(\w+);[\r\n]+ [ ]+\2\.Fill\(.*{}\);
    Replace with: $1$2{};
    Directory: D:\Src\ITK\Modules

- Follow-up to pull request InsightSoftwareConsortium#4897
commit 4733550
"STYLE: Replace `Fill(0)` on local variables with `{}` initialization"
N-Dekker added a commit to N-Dekker/ITK that referenced this pull request Oct 25, 2024
Using Notepad++, Replace in Files, doing:

    Find what: ^( [ ]+[^ ].* )(\w+);[\r\n]+ [ ]+\2\.Fill\(.*{}\);
    Replace with: $1$2{};
    Directory: D:\Src\ITK\Modules

Manually removed the ValueType alias from `BarycentricCombination::Evaluate`, to
avoid "unused type alias" warnings.

- Follow-up to pull request InsightSoftwareConsortium#4897
commit 4733550
"STYLE: Replace `Fill(0)` on local variables with `{}` initialization"
N-Dekker added a commit to SuperElastix/elastix that referenced this pull request Oct 26, 2024
Replaced code of the form

    Type var;
    var.Fill(0);

and

    Type var;
    var.Fill(ElementType{});

with `Type var{};`

Using Notepad++, Replace in Files, doing:

    Find what: ^( [ ]+)([^ ].* )(\w+);[\r\n]+\1\3\.Fill\(0\.?0?\);
    Find what: ^( [ ]+)([^ ].* )(\w+);[\r\n]+\1\3\.Fill\(.*{}\);
    Replace with: $1$2$3{};
    [v] Match case
    (*) Regular expression

- Following ITK pull request InsightSoftwareConsortium/ITK#4897
commit InsightSoftwareConsortium/ITK@4733550
N-Dekker added a commit to SuperElastix/elastix that referenced this pull request Oct 26, 2024
Replaced code of the form

    Type var;
    var.Fill(0);

and

    Type var;
    var.Fill(ElementType{});

with `Type var{};`

Using Notepad++, Replace in Files, doing:

    Find what: ^( [ ]+)([^ ].* )(\w+);[\r\n]+\1\3\.Fill\(0\.?0?\);
    Find what: ^( [ ]+)([^ ].* )(\w+);[\r\n]+\1\3\.Fill\(.*{}\);
    Replace with: $1$2$3{};
    [v] Match case
    (*) Regular expression

- Following ITK pull request InsightSoftwareConsortium/ITK#4897
commit InsightSoftwareConsortium/ITK@4733550
N-Dekker added a commit to N-Dekker/ITKSphinxExamples that referenced this pull request Nov 4, 2024
N-Dekker added a commit to N-Dekker/ITKSphinxExamples that referenced this pull request Nov 4, 2024
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:Numerics Issues affecting the Numerics module area:Registration Issues affecting the Registration module area:Segmentation Issues affecting the Segmentation module type:Style Style changes: no logic impact (indentation, comments, naming) type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants