From 7933a9b6c8f5d2e6c08020e80ed68f5346a2c92e Mon Sep 17 00:00:00 2001 From: Idan Horowitz Date: Thu, 3 Feb 2022 16:56:49 +0200 Subject: [PATCH] AK: Stop using the make factory function in Trie This function is infallible, and so we would like to exclude it from the Kernel, which includes this header. --- AK/Trie.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AK/Trie.h b/AK/Trie.h index 6e954fbee9b..6436d7375c3 100644 --- a/AK/Trie.h +++ b/AK/Trie.h @@ -135,7 +135,7 @@ public: { auto it = m_children.find(value); if (it == m_children.end()) { - auto node = make(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(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(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(move(root)); }