Skip to content

STYLE: Replace T var = NumericTraits<T>::ZeroValue() having whitespace#4015

Merged
hjmjohnson merged 1 commit intoInsightSoftwareConsortium:masterfrom
N-Dekker:Replace-NumericTraits-ZeroValue-init-having-whitespace
Apr 18, 2023
Merged

STYLE: Replace T var = NumericTraits<T>::ZeroValue() having whitespace#4015
hjmjohnson merged 1 commit intoInsightSoftwareConsortium:masterfrom
N-Dekker:Replace-NumericTraits-ZeroValue-init-having-whitespace

Conversation

@N-Dekker
Copy link
Copy Markdown
Contributor

Replaced initialization by NumericTraits<T>::ZeroValue() with empty {} initializers. Did so by Replace in Files, using regular expressions:

Find what: (.+)([ ]+\w+) = NumericTraits<\1>::ZeroValue\(\);
Find what: (.+)([ ]+\w+) = itk::NumericTraits<\1>::ZeroValue\(\);
Find what: (.+)([ ]+\w+) =\r\n[ ]+NumericTraits<\1>::ZeroValue\(\);
Find what: (.+)([ ]+\w+) =\r\n[ ]+itk::NumericTraits<\1>::ZeroValue\(\);
Replace with: $1$2{};

Follow-up to pull request #3958 commit 42b0bfc "STYLE: Replace T var = NumericTraits<T>::ZeroValue() with T var{}" (which did not yet address initializations of which the specification of T has one or more spaces inside, and initializations that took multiple lines of code.)

Replaced initialization by `NumericTraits<T>::ZeroValue()` with empty `{}`
initializers. Did so by Replace in Files, using regular expressions:

    Find what: (.+)([ ]+\w+) = NumericTraits<\1>::ZeroValue\(\);
    Find what: (.+)([ ]+\w+) = itk::NumericTraits<\1>::ZeroValue\(\);
    Find what: (.+)([ ]+\w+) =\r\n[ ]+NumericTraits<\1>::ZeroValue\(\);
    Find what: (.+)([ ]+\w+) =\r\n[ ]+itk::NumericTraits<\1>::ZeroValue\(\);
    Replace with: $1$2{};

Follow-up to pull request InsightSoftwareConsortium#3958
commit 42b0bfc
"STYLE: Replace `T var = NumericTraits<T>::ZeroValue()` with `T var{}`" (which
did not yet address initializations of which the specification of `T` has one or
more spaces inside, and initializations that took multiple lines of code.)
@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:Registration Issues affecting the Registration module area:Segmentation Issues affecting the Segmentation module type:Style Style changes: no logic impact (indentation, comments, naming) labels Apr 17, 2023
Copy link
Copy Markdown
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.

Thank you for your tenacity in tracking these down.

@N-Dekker N-Dekker marked this pull request as ready for review April 17, 2023 17:30
@hjmjohnson hjmjohnson merged commit b7bfef3 into InsightSoftwareConsortium:master Apr 18, 2023
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: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.

3 participants