1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:28:10 +00:00

LibWeb: Remove pointless type casts

In these cases, the parameters' static type matched the desired dynamic
type, so these calls were discarded.
This commit is contained in:
Daniel Bertalan 2021-08-11 14:10:09 +02:00 committed by Andreas Kling
parent f95a11a7da
commit b19fe744ab
2 changed files with 1 additions and 4 deletions

View file

@ -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;

View file

@ -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;