Simplify a bit
Change-Id: I77cb2b08b1d92f3c8ad406bb1ebd2d080cdbfa1a Reviewed-on: https://gerrit.libreoffice.org/3123 Reviewed-by: Luboš Luňák <l.lunak@suse.cz> Tested-by: Luboš Luňák <l.lunak@suse.cz>
This commit is contained in:
committed by
Luboš Luňák
parent
974e18faea
commit
92824e8e25
@@ -301,14 +301,14 @@ void OHierarchyElement_Impl::RemoveElement( const ::rtl::Reference< OHierarchyEl
|
||||
{
|
||||
{
|
||||
::osl::MutexGuard aGuard( m_aMutex );
|
||||
for ( OHierarchyElementList_Impl::iterator aIter = m_aChildren.begin();
|
||||
aIter != m_aChildren.end(); /* increment is done in body */)
|
||||
OHierarchyElementList_Impl::iterator aIter = m_aChildren.begin();
|
||||
const OHierarchyElementList_Impl::const_iterator aEnd = m_aChildren.end();
|
||||
while (aIter != aEnd)
|
||||
{
|
||||
OHierarchyElementList_Impl::iterator aTmpIter = aIter;
|
||||
++aIter;
|
||||
|
||||
if ( aTmpIter->second == aRef )
|
||||
m_aChildren.erase( aTmpIter );
|
||||
if (aIter->second == aRef )
|
||||
aIter = m_aChildren.erase(aIter);
|
||||
else
|
||||
++aIter;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user