mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 12:17:35 +00:00
Kernel: Support try-inserting RedBlackTree entry values by reference
This commit is contained in:
parent
8aa723d159
commit
85437abfad
1 changed files with 7 additions and 2 deletions
|
@ -449,9 +449,14 @@ public:
|
||||||
return &node->value;
|
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)
|
ErrorOr<void> try_insert(K key, V&& value)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue