From a5b46ba6366b11de3250b9ac101f3e04755725d1 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Wed, 8 Mar 2023 02:56:54 +0700 Subject: [PATCH] Remove unneeded check `if (this != _STD addressof(_Right))` (#3540) --- stl/inc/memory | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/stl/inc/memory b/stl/inc/memory index 00a3b868a..a0cdd884d 100644 --- a/stl/inc/memory +++ b/stl/inc/memory @@ -3257,10 +3257,8 @@ public: template , int> = 0> _CONSTEXPR23 unique_ptr& operator=(unique_ptr&& _Right) noexcept { - if (this != _STD addressof(_Right)) { - reset(_Right.release()); - _Mypair._Get_first() = _STD forward<_Dx>(_Right._Mypair._Get_first()); - } + reset(_Right.release()); + _Mypair._Get_first() = _STD forward<_Dx>(_Right._Mypair._Get_first()); return *this; }