File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed
IntelPresentMon/CommonUtilities/win Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -17,16 +17,13 @@ namespace pmon::util::win
1717 }
1818 Handle::Handle (Handle&& other) noexcept
1919 :
20- handle_ (other.handle_)
21- {
22- other.handle_ = nullptr ;
23- }
20+ handle_ (std::exchange(other.handle_, nullptr ))
21+ {}
2422 Handle& Handle::operator =(Handle&& other) noexcept
2523 {
2624 if (this != &other) {
2725 Clear ();
28- handle_ = other.handle_ ;
29- other.handle_ = nullptr ;
26+ handle_ = std::exchange (other.handle_ , nullptr );
3027 }
3128 return *this ;
3229 }
@@ -50,9 +47,7 @@ namespace pmon::util::win
5047 }
5148 Handle::HandleType Handle::Release ()
5249 {
53- const auto temp = handle_;
54- Clear ();
55- return temp;
50+ return std::exchange (handle_, nullptr );
5651 }
5752 Handle::operator bool () const noexcept
5853 {
You can’t perform that action at this time.
0 commit comments