1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:57:45 +00:00

AK: Mark RedBlackTree functions as [[nodiscard]]

This commit is contained in:
Brian Gianforcaro 2021-07-17 02:26:04 -07:00 committed by Andreas Kling
parent af65c4d8b7
commit 6059d69249
2 changed files with 3 additions and 2 deletions

View file

@ -83,6 +83,7 @@ public:
} }
[[nodiscard]] bool is_end() const { return !m_node; } [[nodiscard]] bool is_end() const { return !m_node; }
[[nodiscard]] bool is_begin() const { return !m_prev; } [[nodiscard]] bool is_begin() const { return !m_prev; }
[[nodiscard]] auto key() const { return m_node->key; }
private: private:
friend class IntrusiveRedBlackTree; friend class IntrusiveRedBlackTree;
@ -159,7 +160,7 @@ public:
VERIFY(!is_in_tree()); VERIFY(!is_in_tree());
} }
bool is_in_tree() [[nodiscard]] bool is_in_tree() const
{ {
return m_in_tree; return m_in_tree;
} }

View file

@ -406,7 +406,7 @@ public:
[[nodiscard]] bool is_end() const { return !m_node; } [[nodiscard]] bool is_end() const { return !m_node; }
[[nodiscard]] bool is_begin() const { return !m_prev; } [[nodiscard]] bool is_begin() const { return !m_prev; }
auto key() const { return m_node->key; } [[nodiscard]] auto key() const { return m_node->key; }
private: private:
friend TreeType; friend TreeType;