mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 04:25:13 +00:00
AK: Use MUST + try_empend so AK::Trie continues to compile in the kernel
This commit is contained in:
parent
7d27798c8d
commit
48206be121
Notes:
sideshowbarker
2024-07-17 21:36:21 +09:00
Author: https://github.com/bgianfo Commit: https://github.com/SerenityOS/serenity/commit/48206be1216 Pull-request: https://github.com/SerenityOS/serenity/pull/11588
1 changed files with 5 additions and 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()
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue