From b9b264e97ab4935a4a84e9916bdd076106bab759 Mon Sep 17 00:00:00 2001 From: Shannon Booth Date: Mon, 1 Apr 2024 15:14:53 +0200 Subject: [PATCH] LibWeb: Remove redundant is_empty check from is_supported_property_index An empty list of elements will not return true for any unsigned number, so we can simply remove this check. --- Userland/Libraries/LibWeb/DOM/HTMLCollection.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/Userland/Libraries/LibWeb/DOM/HTMLCollection.cpp b/Userland/Libraries/LibWeb/DOM/HTMLCollection.cpp index c639a72bcf..4d8bbd79ef 100644 --- a/Userland/Libraries/LibWeb/DOM/HTMLCollection.cpp +++ b/Userland/Libraries/LibWeb/DOM/HTMLCollection.cpp @@ -151,9 +151,6 @@ bool HTMLCollection::is_supported_property_index(u32 index) const // The object’s supported property indices are the numbers in the range zero to one less than the number of elements represented by the collection. // If there are no such elements, then there are no supported property indices. auto elements = collect_matching_elements(); - if (elements.is_empty()) - return false; - return index < elements.size(); }