mirror of https://github.com/CGAL/cgal
Better remove() / is_removed() methods
This commit is contained in:
parent
6c6244d9b8
commit
e11e12b69f
|
|
@ -590,7 +590,10 @@ public:
|
||||||
*/
|
*/
|
||||||
void remove (const Index& index)
|
void remove (const Index& index)
|
||||||
{
|
{
|
||||||
remove (m_indices.begin() + index);
|
iterator it = m_indices.begin() + index;
|
||||||
|
while (*it != index)
|
||||||
|
it = m_indices.begin() + *it;
|
||||||
|
remove (it);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -610,6 +613,14 @@ public:
|
||||||
return (std::distance (it, garbage_begin()) <= 0);
|
return (std::distance (it, garbage_begin()) <= 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool is_removed (const Index& index) const
|
||||||
|
{
|
||||||
|
const_iterator it = m_indices.begin() + index;
|
||||||
|
while (*it != index)
|
||||||
|
it = m_indices.begin() + *it;
|
||||||
|
return is_removed (it);
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Returns the constant iterator to the first element marked as removed
|
\brief Returns the constant iterator to the first element marked as removed
|
||||||
(equal to `garbage_end()` if no elements are marked as removed.
|
(equal to `garbage_end()` if no elements are marked as removed.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue