mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-21 18:15:58 +00:00
Kernel: Support try-inserting RedBlackTree entry values by reference
This commit is contained in:
parent
8aa723d159
commit
85437abfad
|
@ -449,9 +449,14 @@ public:
|
|||
return &node->value;
|
||||
}
|
||||
|
||||
void insert(K key, const V& value)
|
||||
ErrorOr<void> try_insert(K key, V const& value)
|
||||
{
|
||||
insert(key, V(value));
|
||||
return try_insert(key, V(value));
|
||||
}
|
||||
|
||||
void insert(K key, V const& value)
|
||||
{
|
||||
MUST(try_insert(key, value));
|
||||
}
|
||||
|
||||
ErrorOr<void> try_insert(K key, V&& value)
|
||||
|
|
Loading…
Reference in a new issue