diff options
author | Andreas Kling <kling@serenityos.org> | 2021-07-15 01:25:54 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-07-15 01:48:10 +0200 |
commit | 980f40900332f60ed1e4bc0452d74239ec723cf5 (patch) | |
tree | 41b9a4ee03102f1063bcff46c21e6f1e34847560 /AK/RedBlackTree.h | |
parent | 4ff35c23d3ffbbfaa502ab69d071f9b875be4d31 (diff) | |
download | serenity-980f40900332f60ed1e4bc0452d74239ec723cf5.zip |
AK: Allow getting the key from a RedBlackTree iterator
Diffstat (limited to 'AK/RedBlackTree.h')
-rw-r--r-- | AK/RedBlackTree.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/AK/RedBlackTree.h b/AK/RedBlackTree.h index 99a7527e00..4647b555f2 100644 --- a/AK/RedBlackTree.h +++ b/AK/RedBlackTree.h @@ -406,6 +406,8 @@ public: [[nodiscard]] bool is_end() const { return !m_node; } [[nodiscard]] bool is_begin() const { return !m_prev; } + auto key() const { return m_node->key; } + private: friend TreeType; explicit RedBlackTreeIterator(typename TreeType::Node* node, typename TreeType::Node* prev = nullptr) |