mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-14 16:55:36 +08:00
refs #106, moved removeIf from CSequence to CContainerBase and added remove method in CCollection (CSequence already had a remove method)
This commit is contained in:
@@ -186,6 +186,12 @@ namespace BlackMisc
|
||||
*/
|
||||
const_iterator find(const T &value) const { Q_ASSERT(pimpl()); return pimpl()->find(value); }
|
||||
|
||||
/*!
|
||||
* \brief Efficient remove using the find and erase of the implementation container. Typically O(log n).
|
||||
* \pre The sequence must be initialized.
|
||||
*/
|
||||
void remove(const T &object) { auto it = find(object); if (it != end()) { erase(pos); } }
|
||||
|
||||
/*!
|
||||
* \brief Test for equality.
|
||||
* \todo Improve inefficient implementation.
|
||||
|
||||
Reference in New Issue
Block a user