1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:57:44 +00:00

LibWeb: Simplify some WeakPtr assignments

We can assign a raw pointer directly to a WeakPtr without null-checking
it first.
This commit is contained in:
Andreas Kling 2022-07-04 00:42:44 +02:00
parent ebac8abc04
commit 7a7043f821
3 changed files with 4 additions and 16 deletions

View file

@ -792,10 +792,7 @@ void Node::removed_last_ref()
void Node::set_layout_node(Badge<Layout::Node>, Layout::Node* layout_node) const
{
if (layout_node)
m_layout_node = layout_node->make_weak_ptr();
else
m_layout_node = nullptr;
m_layout_node = layout_node;
}
EventTarget* Node::get_parent(Event const&)