Bladeren bron

LibWeb: Remove some uneeded const_casts from HTMLCollection

Correcting a variable name while we're at it.
Shannon Booth 1 jaar geleden
bovenliggende
commit
094ab8b4d2
1 gewijzigde bestanden met toevoegingen van 4 en 4 verwijderingen
  1. 4 4
      Userland/Libraries/LibWeb/DOM/HTMLCollection.cpp

+ 4 - 4
Userland/Libraries/LibWeb/DOM/HTMLCollection.cpp

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