mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:17:45 +00:00
AK: Remove unnecessary null checks in RedBlackTree
This commit is contained in:
parent
cd285894b2
commit
a702b6ec42
1 changed files with 4 additions and 8 deletions
|
@ -521,10 +521,8 @@ public:
|
|||
|
||||
void clear()
|
||||
{
|
||||
if (this->m_root) {
|
||||
delete this->m_root;
|
||||
this->m_root = nullptr;
|
||||
}
|
||||
delete this->m_root;
|
||||
this->m_root = nullptr;
|
||||
this->m_minimum = nullptr;
|
||||
this->m_size = 0;
|
||||
}
|
||||
|
@ -542,10 +540,8 @@ private:
|
|||
|
||||
~Node()
|
||||
{
|
||||
if (this->left_child)
|
||||
delete this->left_child;
|
||||
if (this->right_child)
|
||||
delete this->right_child;
|
||||
delete this->left_child;
|
||||
delete this->right_child;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue