diff options
author | Chris Robinson <[email protected]> | 2022-12-05 14:51:03 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2022-12-05 14:51:03 -0800 |
commit | df6d61dd40b602af55f903564358b083bb8b37e4 (patch) | |
tree | 84113a098867e2ba82aa1f156911e94755fde727 /common/intrusive_ptr.h | |
parent | 73df39b8f8cefa0c0fca0e287b548063e9e62636 (diff) |
Use standard likely/unlikely attributes when available
Diffstat (limited to 'common/intrusive_ptr.h')
-rw-r--r-- | common/intrusive_ptr.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/common/intrusive_ptr.h b/common/intrusive_ptr.h index 9e206a6b..ba932b95 100644 --- a/common/intrusive_ptr.h +++ b/common/intrusive_ptr.h @@ -18,7 +18,7 @@ public: unsigned int release() noexcept { auto ref = DecrementRef(mRef); - if UNLIKELY(ref == 0) + if(ref == 0) [[alunlikely]] delete static_cast<T*>(this); return ref; } @@ -71,7 +71,7 @@ public: } intrusive_ptr& operator=(intrusive_ptr&& rhs) noexcept { - if(likely(&rhs != this)) + if(&rhs != this) [[allikely]] { if(mPtr) mPtr->release(); mPtr = std::exchange(rhs.mPtr, nullptr); |