mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 05:37:44 +00:00
AK: Expose RedBlackTree::find_smallest_not_below()
This commit is contained in:
parent
02c18bf6de
commit
908d5a2853
2 changed files with 17 additions and 0 deletions
|
@ -467,6 +467,14 @@ public:
|
|||
return &node->value;
|
||||
}
|
||||
|
||||
[[nodiscard]] V* find_smallest_not_below(K key)
|
||||
{
|
||||
auto* node = static_cast<Node*>(BaseTree::find_smallest_not_below(this->m_root, key));
|
||||
if (!node)
|
||||
return nullptr;
|
||||
return &node->value;
|
||||
}
|
||||
|
||||
ErrorOr<void> try_insert(K key, V const& value)
|
||||
{
|
||||
return try_insert(key, V(value));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue