Skip to content

Commit 2859d67

Browse files
N-Dekkerdzenanz
authored andcommitted
STYLE: Simply assign factories, in ObjectFactoryBase::RegisterInternal()
Replaced `clear` and `push_back` calls with a simple `std::list` assignment to `m_RegisteredFactories`.
1 parent 75b9967 commit 2859d67

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

Modules/Core/Common/src/itkObjectFactoryBase.cxx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -249,14 +249,9 @@ ObjectFactoryBase::RegisterInternal()
249249

250250
// Guarantee that no internal factories have already been registered.
251251
itkAssertInDebugAndIgnoreInReleaseMacro(m_PimplGlobals->m_RegisteredFactories.empty());
252-
m_PimplGlobals->m_RegisteredFactories.clear();
253252

254-
// Register all factories registered by the
255-
// "RegisterFactoryInternal" method
256-
for (auto & internalFactory : m_PimplGlobals->m_InternalFactories)
257-
{
258-
m_PimplGlobals->m_RegisteredFactories.push_back(internalFactory);
259-
}
253+
// Register all factories registered by the "RegisterFactoryInternal" method
254+
m_PimplGlobals->m_RegisteredFactories = m_PimplGlobals->m_InternalFactories;
260255
}
261256

262257
/**

0 commit comments

Comments
 (0)