From 6059d692495d2558882b7e2fca82d20c7e7007c6 Mon Sep 17 00:00:00 2001 From: Brian Gianforcaro Date: Sat, 17 Jul 2021 02:26:04 -0700 Subject: [PATCH] AK: Mark RedBlackTree functions as [[nodiscard]] --- AK/IntrusiveRedBlackTree.h | 3 ++- AK/RedBlackTree.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/AK/IntrusiveRedBlackTree.h b/AK/IntrusiveRedBlackTree.h index c049961a4c..5791760801 100644 --- a/AK/IntrusiveRedBlackTree.h +++ b/AK/IntrusiveRedBlackTree.h @@ -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; } diff --git a/AK/RedBlackTree.h b/AK/RedBlackTree.h index 236d84be63..236107870a 100644 --- a/AK/RedBlackTree.h +++ b/AK/RedBlackTree.h @@ -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;