AK: Remove unnecessary null checks in RedBlackTree

This commit is contained in:
Andreas Kling 2022-01-12 12:28:03 +01:00
parent cd285894b2
commit a702b6ec42
Notes: sideshowbarker 2024-07-18 08:59:31 +09:00

View file

@ -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;
}
};
};