From 2f491e7769eff773d728ff53a40c8681a35cf4c0 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 25 Nov 2020 20:08:37 +0100 Subject: [PATCH] AK: Always inline RefPtr::operator bool() and RefPtr::is_null() --- AK/RefPtr.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AK/RefPtr.h b/AK/RefPtr.h index ecdf9973e4..3f9dfaedc5 100644 --- a/AK/RefPtr.h +++ b/AK/RefPtr.h @@ -361,7 +361,7 @@ public: ALWAYS_INLINE operator const T*() const { return as_ptr(); } ALWAYS_INLINE operator T*() { return as_ptr(); } - operator bool() { return !is_null(); } + ALWAYS_INLINE operator bool() { return !is_null(); } bool operator==(std::nullptr_t) const { return is_null(); } bool operator!=(std::nullptr_t) const { return !is_null(); } @@ -378,7 +378,7 @@ public: bool operator==(T* other) { return as_ptr() == other; } bool operator!=(T* other) { return as_ptr() != other; } - bool is_null() const { return PtrTraits::is_null(m_bits.load(AK::MemoryOrder::memory_order_relaxed)); } + ALWAYS_INLINE bool is_null() const { return PtrTraits::is_null(m_bits.load(AK::MemoryOrder::memory_order_relaxed)); } template::value && !IsNullPointer::value>::Type* = nullptr> typename PtrTraits::NullType null_value() const