summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Gianforcaro <bgianf@serenityos.org>2022-01-03 03:13:28 -0800
committerAndreas Kling <kling@serenityos.org>2022-01-05 14:04:18 +0100
commit48206be1216cd07b90f61b98e86ad88e03ade7ed (patch)
tree33df47037b3b37e2c8d4db0e8d91fdde5c41ebe4
parent7d27798c8d8cd6bd5edc1ef7f629b2a738c8f21f (diff)
downloadserenity-48206be1216cd07b90f61b98e86ad88e03ade7ed.zip
AK: Use MUST + try_empend so AK::Trie continues to compile in the kernel
-rw-r--r--AK/Trie.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/AK/Trie.h b/AK/Trie.h
index 1c289bfadc..6e954fbee9 100644
--- a/AK/Trie.h
+++ b/AK/Trie.h
@@ -43,7 +43,8 @@ class Trie {
explicit ConstIterator(const Trie& node)
{
m_current_node = &node;
- m_state.empend(false, node.m_children.begin(), node.m_children.end());
+ // FIXME: Figure out how to OOM harden this iterator.
+ MUST(m_state.try_empend(false, node.m_children.begin(), node.m_children.end()));
}
private:
@@ -58,7 +59,9 @@ class Trie {
return pop_and_get_next();
m_current_node = &*(*current_state.it).value;
- m_state.empend(false, m_current_node->m_children.begin(), m_current_node->m_children.end());
+
+ // FIXME: Figure out how to OOM harden this iterator.
+ MUST(m_state.try_empend(false, m_current_node->m_children.begin(), m_current_node->m_children.end()));
}
void pop_and_get_next()
{