LibWeb/CSS: Compare MediaFeatureValues using references not copies

This commit is contained in:
Sam Atkins 2025-03-14 10:46:09 +00:00
commit 1e6f703b30
Notes: github-actions[bot] 2025-03-17 10:01:31 +00:00
2 changed files with 2 additions and 2 deletions

View file

@ -144,7 +144,7 @@ MatchResult MediaFeature::evaluate(HTML::Window const* window) const
VERIFY_NOT_REACHED(); VERIFY_NOT_REACHED();
} }
bool MediaFeature::compare(HTML::Window const& window, MediaFeatureValue left, Comparison comparison, MediaFeatureValue right) bool MediaFeature::compare(HTML::Window const& window, MediaFeatureValue const& left, Comparison comparison, MediaFeatureValue const& right)
{ {
if (!left.is_same_type(right)) if (!left.is_same_type(right))
return false; return false;

View file

@ -173,7 +173,7 @@ private:
{ {
} }
static bool compare(HTML::Window const& window, MediaFeatureValue left, Comparison comparison, MediaFeatureValue right); static bool compare(HTML::Window const& window, MediaFeatureValue const& left, Comparison comparison, MediaFeatureValue const& right);
MediaFeatureValue const& value() const { return m_value.get<MediaFeatureValue>(); } MediaFeatureValue const& value() const { return m_value.get<MediaFeatureValue>(); }
Range const& range() const { return m_value.get<Range>(); } Range const& range() const { return m_value.get<Range>(); }