mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
AK: Remove copy_ref().
This patch removes copy_ref() from RefPtr and NonnullRefPtr. This means that it's now okay to simply copy these smart pointers instead: - RefPtr = RefPtr // Okay! - RefPtr = NonnullRefPtr // Okay! - NonnullRefPtr = NonnullRefPtr // Okay! - NonnullRefPtr = RefPtr // Not okay, since RefPtr can be null.
This commit is contained in:
@@ -142,12 +142,6 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
CALLABLE_WHEN(unconsumed)
|
|
||||||
NonnullRefPtr copy_ref() const
|
|
||||||
{
|
|
||||||
return NonnullRefPtr(*m_ptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
CALLABLE_WHEN(unconsumed)
|
CALLABLE_WHEN(unconsumed)
|
||||||
SET_TYPESTATE(consumed)
|
SET_TYPESTATE(consumed)
|
||||||
T& leak_ref()
|
T& leak_ref()
|
||||||
|
|||||||
@@ -177,11 +177,6 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
RefPtr copy_ref() const
|
|
||||||
{
|
|
||||||
return RefPtr(m_ptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
void clear()
|
void clear()
|
||||||
{
|
{
|
||||||
deref_if_not_null(m_ptr);
|
deref_if_not_null(m_ptr);
|
||||||
|
|||||||
Reference in New Issue
Block a user