Skip to content

STYLE: Replace Fill(0) on local variables with {} initialization#1257

Merged
N-Dekker merged 1 commit intomainfrom
Replace-Fill-with-init
Oct 26, 2024
Merged

STYLE: Replace Fill(0) on local variables with {} initialization#1257
N-Dekker merged 1 commit intomainfrom
Replace-Fill-with-init

Conversation

@N-Dekker
Copy link
Copy Markdown
Member

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

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 N-Dekker merged commit 0bece23 into main Oct 26, 2024
@N-Dekker N-Dekker deleted the Replace-Fill-with-init branch October 26, 2024 10:19
N-Dekker added a commit that referenced this pull request Oct 29, 2024
Using Notepad++, Replace in Files, doing:

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

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

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

- Follow-up to pull request #1257 commit 0bece23 "STYLE: Replace `Fill(0)` on local variables with `{}` initialization"
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