mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 13:17:35 +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
1 changed files with 2 additions and 2 deletions
|
@ -135,7 +135,7 @@ public:
|
||||||
{
|
{
|
||||||
auto it = m_children.find(value);
|
auto it = m_children.find(value);
|
||||||
if (it == m_children.end()) {
|
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;
|
auto& node_ref = *node;
|
||||||
m_children.set(move(value), move(node));
|
m_children.set(move(value), move(node));
|
||||||
return static_cast<BaseType&>(node_ref);
|
return static_cast<BaseType&>(node_ref);
|
||||||
|
@ -195,7 +195,7 @@ public:
|
||||||
{
|
{
|
||||||
Trie root(m_value, m_metadata);
|
Trie root(m_value, m_metadata);
|
||||||
for (auto& it : m_children)
|
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));
|
return static_cast<BaseType&&>(move(root));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue