From a3f913b20b7a168dfd63b8b4bacfce484ad90b00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steven=20Dee=20=28J=C5=8Dshin=29?= Date: Sat, 15 Jun 2024 19:04:09 -0700 Subject: [PATCH] Switch to p --- ctl/unique_ptr.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ctl/unique_ptr.h b/ctl/unique_ptr.h index 8ae17ed27..179beda12 100644 --- a/ctl/unique_ptr.h +++ b/ctl/unique_ptr.h @@ -71,7 +71,7 @@ struct unique_ptr inline void reset(nullptr_t = nullptr) noexcept { - if (*this) + if (p) d(p); p = nullptr; } @@ -81,7 +81,7 @@ struct unique_ptr /* requires is_convertible_v */ inline void reset(U* p2) { - if (*this) { + if (p) { d(p); } p = static_cast(p2); @@ -117,14 +117,14 @@ struct unique_ptr inline element_type& operator*() const noexcept(noexcept(*std::declval())) { - if (!*this) + if (!p) __builtin_trap(); return *p; } inline pointer operator->() const noexcept { - if (!*this) + if (!p) __builtin_trap(); return p; }