diff options
author | Brian Gianforcaro <bgianf@serenityos.org> | 2022-01-03 03:13:28 -0800 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-01-05 14:04:18 +0100 |
commit | 48206be1216cd07b90f61b98e86ad88e03ade7ed (patch) | |
tree | 33df47037b3b37e2c8d4db0e8d91fdde5c41ebe4 | |
parent | 7d27798c8d8cd6bd5edc1ef7f629b2a738c8f21f (diff) | |
download | serenity-48206be1216cd07b90f61b98e86ad88e03ade7ed.zip |
AK: Use MUST + try_empend so AK::Trie continues to compile in the kernel
-rw-r--r-- | AK/Trie.h | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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() { |