diff options
Diffstat (limited to 'Userland/Libraries')
-rw-r--r-- | Userland/Libraries/LibRegex/RegexMatcher.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Userland/Libraries/LibRegex/RegexMatcher.cpp b/Userland/Libraries/LibRegex/RegexMatcher.cpp index b0c8708bad..dbc5b98cbe 100644 --- a/Userland/Libraries/LibRegex/RegexMatcher.cpp +++ b/Userland/Libraries/LibRegex/RegexMatcher.cpp @@ -333,13 +333,12 @@ public: ALWAYS_INLINE void append(T value) { - auto new_node = m_allocator.allocate(); - VERIFY(new_node); - auto node_ptr = new (new_node) Node { move(value), nullptr, nullptr }; + auto node_ptr = m_allocator.allocate(move(value)); + VERIFY(node_ptr); if (!m_first) { - m_first = new_node; - m_last = new_node; + m_first = node_ptr; + m_last = node_ptr; return; } |