1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 08:57:34 +00:00

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

View file

@ -521,10 +521,8 @@ public:
void clear() void clear()
{ {
if (this->m_root) { delete this->m_root;
delete this->m_root; this->m_root = nullptr;
this->m_root = nullptr;
}
this->m_minimum = nullptr; this->m_minimum = nullptr;
this->m_size = 0; this->m_size = 0;
} }
@ -542,10 +540,8 @@ private:
~Node() ~Node()
{ {
if (this->left_child) delete this->left_child;
delete this->left_child; delete this->right_child;
if (this->right_child)
delete this->right_child;
} }
}; };
}; };