STYLE: Replace T var = NumericTraits<T>::ZeroValue() with T var{}#3958
Merged
hjmjohnson merged 1 commit intoInsightSoftwareConsortium:masterfrom Mar 10, 2023
Conversation
Replaced initialization by `NumericTraits<T>::ZeroValue()` with empty `{}`
initializers. Did so by Replace in Files, using regular expressions:
Find what: (\w+)([ ]+\w+) = NumericTraits<\1>::ZeroValue\(\);
Replace with: $1$2{};
Follow-up to pull request InsightSoftwareConsortium#3950
commmit ef5cc8c
"STYLE: Prefer C++11 zero initializer to ZeroValue", by Hans Johnson.
dzenanz
approved these changes
Mar 9, 2023
Contributor
Author
|
@hjmjohnson Was there a specific reason for your pull request #3950 not to address these 300+ cases? Or was it just meant to pave the way for this PR of mine? 😃 |
hjmjohnson
approved these changes
Mar 10, 2023
Member
|
I did what I could in the time I had. I had an insufficient regular expression to capture these cases. |
Contributor
Author
Thanks @hjmjohnson I just wanted to be sure that these cases were not skipped intentionally! 😃 |
N-Dekker
added a commit
to N-Dekker/ITK
that referenced
this pull request
Apr 17, 2023
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.)
N-Dekker
added a commit
to N-Dekker/ITK
that referenced
this pull request
Apr 17, 2023
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.)
hjmjohnson
pushed a commit
that referenced
this pull request
Apr 18, 2023
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.)
N-Dekker
added a commit
to N-Dekker/ITK
that referenced
this pull request
Apr 19, 2023
Replaced brace-initialization by `NumericTraits<T>::ZeroValue()` with empty `{}`
initializers. Did so by Replace in Files, using regular expressions:
Find what: (\w.+)( .+){ 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{}`"
dzenanz
pushed a commit
that referenced
this pull request
Apr 20, 2023
Replaced brace-initialization by `NumericTraits<T>::ZeroValue()` with empty `{}`
initializers. Did so by Replace in Files, using regular expressions:
Find what: (\w.+)( .+){ 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{}`"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaced initialization by
NumericTraits<T>::ZeroValue()with empty{}initializers. Did so by Replace in Files, using regular expressions:Follow-up to pull request #3950 commmit ef5cc8c
"STYLE: Prefer C++11 zero initializer to ZeroValue", by Hans Johnson (@hjmjohnson).