From 580b892b9ebea881db3c0fd99910164f9e1972e6 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 28 Apr 2025 01:35:30 +0200 Subject: [PATCH] AK: Demote VERIFY in NonnullRefPtr to ASSERT NonnullRefPtr almost always has a non-null pointer internally, that's what the class is for, after all! The one edge case where it has null internally is after you move() it. But it's always a bug to use an NNRP after moving from it, and we have clang-tidy yelling at us if that ever happens. Demoting this removes a gazillion overly paranoid null checks. --- AK/NonnullRefPtr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AK/NonnullRefPtr.h b/AK/NonnullRefPtr.h index 762a989cb43..949d14bdb1b 100644 --- a/AK/NonnullRefPtr.h +++ b/AK/NonnullRefPtr.h @@ -212,7 +212,7 @@ private: ALWAYS_INLINE RETURNS_NONNULL T* as_nonnull_ptr() const { - VERIFY(m_ptr); + ASSERT(m_ptr); return m_ptr; }