summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorDaniel Bertalan <dani@danielbertalan.dev>2021-08-11 14:10:09 +0200
committerAndreas Kling <kling@serenityos.org>2021-08-12 21:10:44 +0200
commitb19fe744ab7dbdb66e59853d427e38890646bb14 (patch)
treeb4093a1cb0eb6f69d08efac227542e94e8c3b6a1 /Userland
parentf95a11a7daa7c29aa0a019b9c965bfdd6f3cb69a (diff)
downloadserenity-b19fe744ab7dbdb66e59853d427e38890646bb14.zip
LibWeb: Remove pointless type casts
In these cases, the parameters' static type matched the desired dynamic type, so these calls were discarded.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibWeb/CSS/StyleResolver.cpp2
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp3
2 files changed, 1 insertions, 4 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/StyleResolver.cpp b/Userland/Libraries/LibWeb/CSS/StyleResolver.cpp
index 936d77a414..dd98da083e 100644
--- a/Userland/Libraries/LibWeb/CSS/StyleResolver.cpp
+++ b/Userland/Libraries/LibWeb/CSS/StyleResolver.cpp
@@ -68,8 +68,6 @@ Vector<MatchingRule> StyleResolver::collect_matching_rules(DOM::Element const& e
size_t style_sheet_index = 0;
for_each_stylesheet([&](auto& sheet) {
- if (!is<CSSStyleSheet>(sheet))
- return;
size_t rule_index = 0;
static_cast<CSSStyleSheet const&>(sheet).for_each_effective_style_rule([&](auto& rule) {
size_t selector_index = 0;
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp
index 1d94ea1f90..156f521157 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp
@@ -97,8 +97,7 @@ void HTMLFormElement::submit_form(RefPtr<HTMLElement> submitter, bool from_submi
Vector<URLQueryParam> parameters;
- for_each_in_inclusive_subtree_of_type<HTMLInputElement>([&](auto& node) {
- auto& input = verify_cast<HTMLInputElement>(node);
+ for_each_in_inclusive_subtree_of_type<HTMLInputElement>([&](auto& input) {
if (!input.name().is_null() && (input.type() != "submit" || &input == submitter))
parameters.append({ input.name(), input.value() });
return IterationDecision::Continue;