1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:07:35 +00:00

LibJS: Avoid work in Shape::lookup() if there are no properties

This commit is contained in:
Andreas Kling 2020-10-05 20:48:26 +02:00
parent 69bae3fd9a
commit 148c4161d9

View file

@ -114,6 +114,8 @@ void Shape::visit_children(Cell::Visitor& visitor)
Optional<PropertyMetadata> Shape::lookup(const StringOrSymbol& property_name) const
{
if (m_property_count == 0)
return {};
auto property = property_table().get(property_name);
if (!property.has_value())
return {};