mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-24 09:52:31 +00:00
LibWeb: Remove some uneeded const_casts from HTMLCollection
Correcting a variable name while we're at it.
This commit is contained in:
parent
b1be8bd826
commit
094ab8b4d2
Notes:
sideshowbarker
2024-07-16 20:08:14 +09:00
Author: https://github.com/shannonbooth
Commit: 094ab8b4d2
Pull-request: https://github.com/SerenityOS/serenity/pull/23792
Reviewed-by: https://github.com/awesomekling
1 changed files with 4 additions and 4 deletions
|
@ -158,14 +158,14 @@ WebIDL::ExceptionOr<JS::Value> HTMLCollection::item_value(size_t index) const
|
||||||
auto* element = item(index);
|
auto* element = item(index);
|
||||||
if (!element)
|
if (!element)
|
||||||
return JS::js_undefined();
|
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)
|
if (!element)
|
||||||
return JS::js_undefined();
|
return JS::js_undefined();
|
||||||
return const_cast<Element*>(element);
|
return element;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue