Kernel: Support try-inserting RedBlackTree entry values by reference

This commit is contained in:
Idan Horowitz 2022-01-26 18:32:38 +02:00 committed by Linus Groh
parent 8aa723d159
commit 85437abfad
Notes: sideshowbarker 2024-07-17 20:10:41 +09:00

View file

@ -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)