mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 00:50:22 +00:00
Kernel: Support try-inserting RedBlackTree entry values by reference
This commit is contained in:
parent
8aa723d159
commit
85437abfad
Notes:
sideshowbarker
2024-07-17 20:10:41 +09:00
Author: https://github.com/IdanHo Commit: https://github.com/SerenityOS/serenity/commit/85437abfad4 Pull-request: https://github.com/SerenityOS/serenity/pull/12145 Reviewed-by: https://github.com/linusg ✅
1 changed files with 7 additions and 2 deletions
|
@ -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