From 9f03348ebeed78fa5e55b6d18e9e9adeeeee2c18 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Mon, 6 Mar 2023 07:53:02 +0700 Subject: [PATCH] Remove unneeded check `if (this != _STD addressof(_Right))` --- stl/inc/memory | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/stl/inc/memory b/stl/inc/memory index e7ca9c2cfc2..46346da6164 100644 --- a/stl/inc/memory +++ b/stl/inc/memory @@ -3261,10 +3261,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; }