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
Notes: sideshowbarker 2024-07-18 08:53:25 +09:00
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_begin() const { return !m_prev; }
[[nodiscard]] auto key() const { return m_node->key; }
private:
friend class IntrusiveRedBlackTree;
@ -159,7 +160,7 @@ public:
VERIFY(!is_in_tree());
}
bool is_in_tree()
[[nodiscard]] bool is_in_tree() const
{
return m_in_tree;
}

View file

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