LibWeb: Remove some uneeded const_casts from HTMLCollection

Correcting a variable name while we're at it.
This commit is contained in:
Shannon Booth 2024-04-01 15:23:31 +02:00 committed by Andreas Kling
parent b1be8bd826
commit 094ab8b4d2
Notes: sideshowbarker 2024-07-16 20:08:14 +09:00

View file

@ -158,14 +158,14 @@ WebIDL::ExceptionOr<JS::Value> HTMLCollection::item_value(size_t index) const
auto* element = item(index);
if (!element)
return JS::js_undefined();
return const_cast<Element*>(element);
return element;
}
WebIDL::ExceptionOr<JS::Value> HTMLCollection::named_item_value(FlyString const& index) const
WebIDL::ExceptionOr<JS::Value> HTMLCollection::named_item_value(FlyString const& name) const
{
auto* element = named_item(index);
auto* element = named_item(name);
if (!element)
return JS::js_undefined();
return const_cast<Element*>(element);
return element;
}
}