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.
This commit is contained in:
Shannon Booth
2024-04-01 15:14:53 +02:00
committed by Andreas Kling
parent cdd0038c9e
commit b9b264e97a

View File

@@ -151,9 +151,6 @@ bool HTMLCollection::is_supported_property_index(u32 index) const
// The objects 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();
}