STYLE: SingletonIndex does not need to store the unused func parameter#4164
Merged
dzenanz merged 1 commit intoSep 6, 2023
Merged
Conversation
9d3c6b3 to
8fc9b00
Compare
Contributor
Author
|
Still "draft", just because I would like to have it processed after another pull request #4162, because of possible merge conflicts between them. Update, 5 September 2023: Ready for review now! |
No longer stored the `func` parameter from `SingletonIndex::SetGlobalInstance` and from `Singleton(globalName, func, deleteFunc)`, as it was never actually retrieved from `m_GlobalObjects` afterwards. Deprecated the `SingletonIndex::SingletonData` type alias, as it is no longer used internally anymore, and it should not be public either.
8fc9b00 to
b6d9372
Compare
dzenanz
approved these changes
Sep 5, 2023
hjmjohnson
approved these changes
Sep 6, 2023
N-Dekker
added a commit
to N-Dekker/ITK
that referenced
this pull request
Sep 7, 2023
Added overloads of `SetGlobalInstance` and `Singleton` without the unused `func` parameter. Let the new `SetGlobalInstance` overload just return `void`, instead of `bool`. Deprecated the original overloads. Follow-up to: pull request InsightSoftwareConsortium#4164 commit 6d1c4c7 "STYLE: SingletonIndex does not need to store the unused `func` parameter" pull request InsightSoftwareConsortium#4162 commit 6ec6328 "STYLE: Let `Singleton` assume that SetGlobalInstance always returns true"
N-Dekker
added a commit
to N-Dekker/ITK
that referenced
this pull request
Sep 14, 2023
Added overloads of `SetGlobalInstance` and `Singleton` without the unused `func` parameter. Let the new `SetGlobalInstance` overload just return `void`, instead of `bool`. Deprecated the original overloads, and made them `ITK_FUTURE_LEGACY_REMOVE`. Follow-up to: pull request InsightSoftwareConsortium#4164 commit 6d1c4c7 "STYLE: SingletonIndex does not need to store the unused `func` parameter" pull request InsightSoftwareConsortium#4162 commit 6ec6328 "STYLE: Let `Singleton` assume that SetGlobalInstance always returns true"
dzenanz
pushed a commit
that referenced
this pull request
Sep 18, 2023
Added overloads of `SetGlobalInstance` and `Singleton` without the unused `func` parameter. Let the new `SetGlobalInstance` overload just return `void`, instead of `bool`. Deprecated the original overloads, and made them `ITK_FUTURE_LEGACY_REMOVE`. Follow-up to: pull request #4164 commit 6d1c4c7 "STYLE: SingletonIndex does not need to store the unused `func` parameter" pull request #4162 commit 6ec6328 "STYLE: Let `Singleton` assume that SetGlobalInstance always returns true"
hjmjohnson
pushed a commit
to hjmjohnson/ITK
that referenced
this pull request
May 6, 2026
Added overloads of `SetGlobalInstance` and `Singleton` without the unused `func` parameter. Let the new `SetGlobalInstance` overload just return `void`, instead of `bool`. Deprecated the original overloads, and made them `ITK_FUTURE_LEGACY_REMOVE`. Follow-up to: pull request InsightSoftwareConsortium#4164 commit fb69897 "STYLE: SingletonIndex does not need to store the unused `func` parameter" pull request InsightSoftwareConsortium#4162 commit b83f8e7 "STYLE: Let `Singleton` assume that SetGlobalInstance always returns true"
hjmjohnson
pushed a commit
to hjmjohnson/ITK
that referenced
this pull request
May 12, 2026
Added overloads of `SetGlobalInstance` and `Singleton` without the unused `func` parameter. Let the new `SetGlobalInstance` overload just return `void`, instead of `bool`. Deprecated the original overloads, and made them `ITK_FUTURE_LEGACY_REMOVE`. Follow-up to: pull request InsightSoftwareConsortium#4164 commit 5a01606 "STYLE: SingletonIndex does not need to store the unused `func` parameter" pull request InsightSoftwareConsortium#4162 commit b58e512 "STYLE: Let `Singleton` assume that SetGlobalInstance always returns true"
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.
No longer stored the
funcparameter fromSingletonIndex::SetGlobalInstance, and fromSingleton(globalName, func, deleteFunc), as it was never actually retrieved fromm_GlobalObjectsafterwards.Deprecated the
SingletonIndex::SingletonDatatype alias, as it is no longer used internally anymore, and it should not be public either.Note that even with the initial commit a66337e (pull request #118, Francois Budin (@fbudin69500) and Hans Johnson (@hjmjohnson), February 2019), the value of the
funcparameter was never retrieved fromSingletonIndex::m_GlobalObjects, looking at:https://github.com/InsightSoftwareConsortium/ITK/blob/a66337ec215c88f4900a2caf419b055483c42085/Modules/Core/Common/src/itkSingleton.cxx
https://github.com/InsightSoftwareConsortium/ITK/blob/a66337ec215c88f4900a2caf419b055483c42085/Modules/Core/Common/include/itkSingleton.h