mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:28:12 +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:
parent
ebac8abc04
commit
7a7043f821
3 changed files with 4 additions and 16 deletions
|
@ -25,18 +25,12 @@ void CSSRule::set_css_text(StringView)
|
|||
|
||||
void CSSRule::set_parent_rule(CSSRule* parent_rule)
|
||||
{
|
||||
if (parent_rule)
|
||||
m_parent_rule = parent_rule->make_weak_ptr();
|
||||
else
|
||||
m_parent_rule = nullptr;
|
||||
m_parent_rule = parent_rule;
|
||||
}
|
||||
|
||||
void CSSRule::set_parent_style_sheet(CSSStyleSheet* parent_style_sheet)
|
||||
{
|
||||
if (parent_style_sheet)
|
||||
m_parent_style_sheet = parent_style_sheet->make_weak_ptr();
|
||||
else
|
||||
m_parent_style_sheet = nullptr;
|
||||
m_parent_style_sheet = parent_style_sheet;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue