mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-21 18:15:58 +00:00
AK: Allow RBTree::find_largest_not_above_iterator() to fail
Previously this function would've crashed if the key failed to match any entry.
This commit is contained in:
parent
27e3589f61
commit
913382734c
|
@ -486,6 +486,8 @@ public:
|
|||
ConstIterator find_largest_not_above_iterator(K key) const
|
||||
{
|
||||
auto node = static_cast<Node*>(BaseTree::find_largest_not_above(this->m_root, key));
|
||||
if (!node)
|
||||
return end();
|
||||
return ConstIterator(node, static_cast<Node*>(BaseTree::predecessor(node)));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue