mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 00:50:22 +00:00
AK: Stop using the make<T> factory function in Trie
This function is infallible, and so we would like to exclude it from the Kernel, which includes this header.
This commit is contained in:
parent
3dc8bbbc8b
commit
7933a9b6c8
Notes:
sideshowbarker
2024-07-17 19:49:37 +09:00
Author: https://github.com/IdanHo Commit: https://github.com/SerenityOS/serenity/commit/7933a9b6c8f Pull-request: https://github.com/SerenityOS/serenity/pull/12275
1 changed files with 2 additions and 2 deletions
|
@ -135,7 +135,7 @@ public:
|
|||
{
|
||||
auto it = m_children.find(value);
|
||||
if (it == m_children.end()) {
|
||||
auto node = make<Trie>(value, move(metadata));
|
||||
auto node = adopt_nonnull_own_or_enomem(new (nothrow) Trie(value, move(metadata))).release_value_but_fixme_should_propagate_errors();
|
||||
auto& node_ref = *node;
|
||||
m_children.set(move(value), move(node));
|
||||
return static_cast<BaseType&>(node_ref);
|
||||
|
@ -195,7 +195,7 @@ public:
|
|||
{
|
||||
Trie root(m_value, m_metadata);
|
||||
for (auto& it : m_children)
|
||||
root.m_children.set(it.key, make<Trie>(it.value->deep_copy()));
|
||||
root.m_children.set(it.key, adopt_nonnull_own_or_enomem(new (nothrow) Trie(it.value->deep_copy())).release_value_but_fixme_should_propagate_errors());
|
||||
return static_cast<BaseType&&>(move(root));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue