diff options
author | Idan Horowitz <idan.horowitz@gmail.com> | 2022-02-03 16:56:49 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-02-03 23:33:20 +0100 |
commit | 7933a9b6c8f5d2e6c08020e80ed68f5346a2c92e (patch) | |
tree | e9b1ac96c7aaede3ddc367b5f0f82fc215798b0f /AK/Trie.h | |
parent | 3dc8bbbc8bb0844b8345304d3741e94d53d594e2 (diff) | |
download | serenity-7933a9b6c8f5d2e6c08020e80ed68f5346a2c92e.zip |
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.
Diffstat (limited to 'AK/Trie.h')
-rw-r--r-- | AK/Trie.h | 4 |
1 files changed, 2 insertions, 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)); } |