-
-
Notifications
You must be signed in to change notification settings - Fork 668
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: Remove p->Initialize()
calls directly after p = T::New()
#4972
Merged
hjmjohnson
merged 1 commit into
InsightSoftwareConsortium:master
from
N-Dekker:Remove-Initialize-after-New
Nov 21, 2024
Merged
STYLE: Remove p->Initialize()
calls directly after p = T::New()
#4972
hjmjohnson
merged 1 commit into
InsightSoftwareConsortium:master
from
N-Dekker:Remove-Initialize-after-New
Nov 21, 2024
Conversation
This file contains 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
For any ITK type `T`, `T::New()` does already initialize the object it returns. Using Notepad++, Replace in Files, doing: Find what: (\w+)([ ]+= .+::New\(\);)\r\n[\r\n]* [ ]+\1->Initialize\(\); Replace with: $1$2 Filters: itk*.* !+\test Directory: D:\src\ITK\Modules [v] Match case (*) Regular expression Manually removed an obsolete comment saying `Clear elements`.
github-actions
bot
added
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)
area:Numerics
Issues affecting the Numerics module
labels
Nov 21, 2024
dzenanz
approved these changes
Nov 21, 2024
hjmjohnson
approved these changes
Nov 21, 2024
hjmjohnson
merged commit Nov 21, 2024
674b3d2
into
InsightSoftwareConsortium:master
17 checks passed
N-Dekker
added a commit
to N-Dekker/ITK
that referenced
this pull request
Nov 21, 2024
- Follow-up to pull request InsightSoftwareConsortium#4972 commit 674b3d2 "STYLE: Remove `p->Initialize()` calls directly after `p = T::New()`"
N-Dekker
added a commit
to N-Dekker/ITK
that referenced
this pull request
Nov 21, 2024
- Follow-up to pull request InsightSoftwareConsortium#4972 commit 674b3d2 "STYLE: Remove `p->Initialize()` calls directly after `p = T::New()`"
N-Dekker
added a commit
to N-Dekker/ITK
that referenced
this pull request
Nov 21, 2024
- Follow-up to pull request InsightSoftwareConsortium#4972 commit 674b3d2 "STYLE: Remove `p->Initialize()` calls directly after `p = T::New()`"
N-Dekker
added a commit
to N-Dekker/ITK
that referenced
this pull request
Nov 21, 2024
For most ITK types, `p->Initialize()` has no effect, directly after `p = T::New()`, so the `Initialize()` call might as well be removed. Excluded a `randomNumberGenerator->Initialize()` call from this commit, as that call appears to actually have an effect (randomizing the seed). - Follow-up to pull request InsightSoftwareConsortium#4972 commit 674b3d2 "STYLE: Remove `p->Initialize()` calls directly after `p = T::New()`"
N-Dekker
added a commit
to N-Dekker/ITK
that referenced
this pull request
Nov 21, 2024
- Follow-up to pull request InsightSoftwareConsortium#4972 commit 674b3d2 "STYLE: Remove `p->Initialize()` calls directly after `p = T::New()`"
hjmjohnson
pushed a commit
that referenced
this pull request
Nov 22, 2024
For most ITK types, `p->Initialize()` has no effect, directly after `p = T::New()`, so the `Initialize()` call might as well be removed. Excluded a `randomNumberGenerator->Initialize()` call from this commit, as that call appears to actually have an effect (randomizing the seed). - Follow-up to pull request #4972 commit 674b3d2 "STYLE: Remove `p->Initialize()` calls directly after `p = T::New()`"
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: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)
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.
For any ITK type
T
,T::New()
does already initialize the object it returns.Using Notepad++, Replace in Files, doing:
Manually removed an obsolete comment saying
Clear elements
.