mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
AK: Merge implementations of operator== for Optional
Instead of having a overload of the operator in each specialization of Optional, use a free function as a common implementation.
This commit is contained in:
committed by
Andreas Kling
parent
a4abb35776
commit
d6abd44522
@@ -593,18 +593,6 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<typename O>
|
||||
ALWAYS_INLINE bool operator==(Optional<O> const& other) const
|
||||
{
|
||||
return has_value() == other.has_value() && (!has_value() || value() == other.value());
|
||||
}
|
||||
|
||||
template<typename O>
|
||||
ALWAYS_INLINE bool operator==(O const& other) const
|
||||
{
|
||||
return has_value() && value() == other;
|
||||
}
|
||||
|
||||
void clear()
|
||||
{
|
||||
m_value = {};
|
||||
|
||||
Reference in New Issue
Block a user