Commit fa198f1c authored by hybrid's avatar hybrid

Add another remove method which takes a node instead of a key. This can save a...

Add another remove method which takes a node instead of a key. This can save a second lookup upon removal. Thanks to teto for the idea.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3969 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 688ec5b8
...@@ -819,6 +819,13 @@ class map ...@@ -819,6 +819,13 @@ class map
bool remove(const KeyType& k) bool remove(const KeyType& k)
{ {
Node* p = find(k); Node* p = find(k);
return remove(p);
}
//! Removes a node from the tree and deletes it.
/** \return True if the node was found and deleted */
bool remove(Node* p)
{
if (p == 0) if (p == 0)
{ {
_IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment