1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 08:27:46 +00:00

AK: Remove use of copy_ref().

This commit is contained in:
Andreas Kling 2019-07-11 15:45:11 +02:00
parent 5254a320d8
commit b0372883ff
4 changed files with 11 additions and 8 deletions

View file

@ -64,13 +64,15 @@ public:
{
}
RefPtr(const RefPtr& other)
: m_ptr(const_cast<RefPtr&>(other).copy_ref().leak_ref())
: m_ptr(const_cast<T*>(other.ptr()))
{
ref_if_not_null(m_ptr);
}
template<typename U>
RefPtr(const RefPtr<U>& other)
: m_ptr(const_cast<RefPtr<U>&>(other).copy_ref().leak_ref())
: m_ptr(static_cast<T*>(const_cast<U*>(other.ptr())))
{
ref_if_not_null(m_ptr);
}
~RefPtr()
{