From 77650fe88608b0970455a9725cff41c4aade8f10 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 19 Jan 2022 09:42:49 +0100 Subject: LibWeb: Remove duplicate checks in for_each_effective_style_rule() After confirming the rule types, we can use static_cast instead of verify_cast to avoid some extra work. --- Userland/Libraries/LibWeb/CSS/CSSRuleList.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Userland') diff --git a/Userland/Libraries/LibWeb/CSS/CSSRuleList.cpp b/Userland/Libraries/LibWeb/CSS/CSSRuleList.cpp index b580b0e7fe..984ed095c4 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSRuleList.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSRuleList.cpp @@ -80,22 +80,22 @@ DOM::ExceptionOr CSSRuleList::remove_a_css_rule(u32 index) void CSSRuleList::for_each_effective_style_rule(Function const& callback) const { - for (auto& rule : m_rules) { + for (auto const& rule : m_rules) { switch (rule.type()) { case CSSRule::Type::Style: - callback(verify_cast(rule)); + callback(static_cast(rule)); break; case CSSRule::Type::Import: { - auto const& import_rule = verify_cast(rule); + auto const& import_rule = static_cast(rule); if (import_rule.has_import_result()) import_rule.loaded_style_sheet()->for_each_effective_style_rule(callback); break; } case CSSRule::Type::Media: - verify_cast(rule).for_each_effective_style_rule(callback); + static_cast(rule).for_each_effective_style_rule(callback); break; case CSSRule::Type::Supports: - verify_cast(rule).for_each_effective_style_rule(callback); + static_cast(rule).for_each_effective_style_rule(callback); break; case CSSRule::Type::__Count: VERIFY_NOT_REACHED(); -- cgit v1.2.3