Skip to content

Commit

Permalink
perf: Avoid allocation in stack frame tree
Browse files Browse the repository at this point in the history
  • Loading branch information
slavek-kucera authored Jul 30, 2024
1 parent 4a19fe4 commit ff3ad99
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion parser_library/src/context/source_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ processing_frame_tree::node_pointer processing_frame_tree::step(node_pointer cur
{
assert(current.m_node);

return node_pointer(std::to_address(m_frames.emplace(current.m_node, pos, resource_loc, member, proc_type).first));
const auto [it, _] = m_frames.insert({ current.m_node, pos, resource_loc, member, proc_type });
return node_pointer(std::to_address(it));
}


Expand Down

0 comments on commit ff3ad99

Please sign in to comment.