diff options
author | Chris Robinson <[email protected]> | 2022-03-25 16:36:46 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2022-03-25 16:36:46 -0700 |
commit | 6d0bd1a5320e3103b10e5263732566c9d63981d9 (patch) | |
tree | 3e9a90618752a9c193527cea25c3f0246827089c /common/comptr.h | |
parent | b80dc504958e116f40ac6e8ab827be57a30aa4b0 (diff) |
Simplify some move assignments
Diffstat (limited to 'common/comptr.h')
-rw-r--r-- | common/comptr.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/common/comptr.h b/common/comptr.h index 5984ebd9..3dc574e8 100644 --- a/common/comptr.h +++ b/common/comptr.h @@ -46,10 +46,8 @@ public: { if(likely(&rhs != this)) { - if(mPtr) - mPtr->Release(); - mPtr = rhs.mPtr; - rhs.mPtr = nullptr; + if(mPtr) mPtr->Release(); + mPtr = std::exchange(rhs.mPtr, nullptr); } return *this; } |