1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 05:07:34 +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

@ -752,10 +752,7 @@ bool EventHandler::handle_keyup(KeyCode key, unsigned modifiers, u32 code_point)
void EventHandler::set_mouse_event_tracking_layout_node(Layout::Node* layout_node)
{
if (layout_node)
m_mouse_event_tracking_layout_node = layout_node->make_weak_ptr();
else
m_mouse_event_tracking_layout_node = nullptr;
m_mouse_event_tracking_layout_node = layout_node;
}
}