From 8409178a111424710492a0bcdf692bfa3439b4a5 Mon Sep 17 00:00:00 2001 From: Jonne Ransijn Date: Sun, 27 Oct 2024 01:12:09 +0200 Subject: [PATCH] LibWeb: Return `Web::CSS::Selector::pseudo_element` by reference This avoids many allocations and deallocations. --- Userland/Libraries/LibWeb/CSS/Selector.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/CSS/Selector.h b/Userland/Libraries/LibWeb/CSS/Selector.h index 6a5736a6e5e..e7c772971e8 100644 --- a/Userland/Libraries/LibWeb/CSS/Selector.h +++ b/Userland/Libraries/LibWeb/CSS/Selector.h @@ -243,7 +243,7 @@ public: ~Selector() = default; Vector const& compound_selectors() const { return m_compound_selectors; } - Optional pseudo_element() const { return m_pseudo_element; } + Optional const& pseudo_element() const { return m_pseudo_element; } NonnullRefPtr relative_to(SimpleSelector const&) const; bool contains_the_nesting_selector() const { return m_contains_the_nesting_selector; } NonnullRefPtr absolutized(SimpleSelector const& selector_for_nesting) const;