summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-01-12 12:28:03 +0100
committerAndreas Kling <kling@serenityos.org>2022-01-12 14:52:47 +0100
commita702b6ec428ce8c899c2b2cdea979012ee435c9c (patch)
tree57ec32b833dc4efb2c507b82fc99221cd058cb85
parentcd285894b273a5d7a9bdb7dc1e9128a3fa6a243f (diff)
downloadserenity-a702b6ec428ce8c899c2b2cdea979012ee435c9c.zip
AK: Remove unnecessary null checks in RedBlackTree
-rw-r--r--AK/RedBlackTree.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/AK/RedBlackTree.h b/AK/RedBlackTree.h
index 713888f7f4..e88813402e 100644
--- a/AK/RedBlackTree.h
+++ b/AK/RedBlackTree.h
@@ -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;
}
};
};