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:
Idan Horowitz 2022-02-03 16:56:49 +02:00 committed by Andreas Kling
parent 3dc8bbbc8b
commit 7933a9b6c8
Notes: sideshowbarker 2024-07-17 19:49:37 +09:00

View file

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