diff options
author | Andreas Kling <kling@serenityos.org> | 2022-07-04 00:42:44 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-07-04 22:30:59 +0200 |
commit | 7a7043f821de92a8602ab65b67cc6c522125e356 (patch) | |
tree | 4a8f8c9a17c31a63f52dcc44228cbc576b2f3e5e /Userland/Libraries/LibWeb/CSS | |
parent | ebac8abc04d892b50269e6c51522a0aca2ecf3f7 (diff) | |
download | serenity-7a7043f821de92a8602ab65b67cc6c522125e356.zip |
LibWeb: Simplify some WeakPtr assignments
We can assign a raw pointer directly to a WeakPtr without null-checking
it first.
Diffstat (limited to 'Userland/Libraries/LibWeb/CSS')
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/CSSRule.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/CSSRule.cpp b/Userland/Libraries/LibWeb/CSS/CSSRule.cpp index aeeec6b7fb..bd1b94493a 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSRule.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSRule.cpp @@ -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; } } |