mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-12 02:59:45 +00:00
LibJS: Avoid work in Shape::lookup() if there are no properties
This commit is contained in:
parent
69bae3fd9a
commit
148c4161d9
Notes:
sideshowbarker
2024-07-19 02:01:51 +09:00
Author: https://github.com/awesomekling
Commit: 148c4161d9
1 changed files with 2 additions and 0 deletions
|
@ -114,6 +114,8 @@ void Shape::visit_children(Cell::Visitor& visitor)
|
||||||
|
|
||||||
Optional<PropertyMetadata> Shape::lookup(const StringOrSymbol& property_name) const
|
Optional<PropertyMetadata> Shape::lookup(const StringOrSymbol& property_name) const
|
||||||
{
|
{
|
||||||
|
if (m_property_count == 0)
|
||||||
|
return {};
|
||||||
auto property = property_table().get(property_name);
|
auto property = property_table().get(property_name);
|
||||||
if (!property.has_value())
|
if (!property.has_value())
|
||||||
return {};
|
return {};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue