mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
AK: Remove unnecessary null checks in RedBlackTree
This commit is contained in:
parent
cd285894b2
commit
a702b6ec42
Notes:
sideshowbarker
2024-07-18 08:59:31 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/a702b6ec428
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…
Reference in a new issue