mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
LibWeb: Make CSSStyleRule::qualified_layer_name() return a const-ref
And also make it inline. We were spending 8% of selector matching on creating and destroying FlyString copies here. With this change, it's now ~1%.
This commit is contained in:
committed by
Andreas Kling
parent
ef4f5ac8fb
commit
b2aff403fc
@@ -58,7 +58,14 @@ protected:
|
||||
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
FlyString const& parent_layer_internal_qualified_name() const;
|
||||
[[nodiscard]] FlyString const& parent_layer_internal_qualified_name() const
|
||||
{
|
||||
if (!m_cached_layer_name.has_value())
|
||||
return parent_layer_internal_qualified_name_slow_case();
|
||||
return m_cached_layer_name.value();
|
||||
}
|
||||
|
||||
[[nodiscard]] FlyString const& parent_layer_internal_qualified_name_slow_case() const;
|
||||
|
||||
JS::GCPtr<CSSRule> m_parent_rule;
|
||||
JS::GCPtr<CSSStyleSheet> m_parent_style_sheet;
|
||||
|
||||
Reference in New Issue
Block a user