From 094ab8b4d291ab612036e691c5ec920a90c1d4ad Mon Sep 17 00:00:00 2001 From: Shannon Booth Date: Mon, 1 Apr 2024 15:23:31 +0200 Subject: [PATCH] LibWeb: Remove some uneeded const_casts from HTMLCollection Correcting a variable name while we're at it. --- Userland/Libraries/LibWeb/DOM/HTMLCollection.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Userland/Libraries/LibWeb/DOM/HTMLCollection.cpp b/Userland/Libraries/LibWeb/DOM/HTMLCollection.cpp index 31365c55301..d7d5b3af0b1 100644 --- a/Userland/Libraries/LibWeb/DOM/HTMLCollection.cpp +++ b/Userland/Libraries/LibWeb/DOM/HTMLCollection.cpp @@ -158,14 +158,14 @@ WebIDL::ExceptionOr HTMLCollection::item_value(size_t index) const auto* element = item(index); if (!element) return JS::js_undefined(); - return const_cast(element); + return element; } -WebIDL::ExceptionOr HTMLCollection::named_item_value(FlyString const& index) const +WebIDL::ExceptionOr 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); + return element; } }