Skip to content

Commit

Permalink
STYLE: Remove const overload of SubjectImplementation::AddObserver
Browse files Browse the repository at this point in the history
`SubjectImplementation` is an internal (hidden) helper class of `itk::Object`,
which only uses the non-const overload of `SubjectImplementation::AddObserver`.

Removing this unused overload reduces maintenance.
  • Loading branch information
N-Dekker authored and dzenanz committed Sep 19, 2022
1 parent 62eb5ca commit ebddf08
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions Modules/Core/Common/src/itkObject.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,6 @@ class ITKCommon_HIDDEN SubjectImplementation
unsigned long
AddObserver(const EventObject & event, Command * cmd);

unsigned long
AddObserver(const EventObject & event, Command * cmd) const;

void
RemoveObserver(unsigned long tag);

Expand Down Expand Up @@ -139,17 +136,6 @@ SubjectImplementation::AddObserver(const EventObject & event, Command * cmd)
return ptr->m_Tag;
}

unsigned long
SubjectImplementation::AddObserver(const EventObject & event, Command * cmd) const
{
auto * ptr = new Observer(cmd, event.MakeObject(), m_Count);
auto * me = const_cast<SubjectImplementation *>(this);

me->m_Observers.push_back(ptr);
me->m_Count++;
return ptr->m_Tag;
}

void
SubjectImplementation::RemoveObserver(unsigned long tag)
{
Expand Down

0 comments on commit ebddf08

Please sign in to comment.