From e9c3ed1531edb9ecff86ed309c4fbd5e4e1e549a Mon Sep 17 00:00:00 2001 From: Christian Mazakas Date: Tue, 4 Oct 2022 14:49:40 -0700 Subject: [PATCH] Remove unnecessary self-alias checks in copy-assignment operators --- include/boost/unordered/unordered_flat_map.hpp | 4 +--- include/boost/unordered/unordered_flat_set.hpp | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/include/boost/unordered/unordered_flat_map.hpp b/include/boost/unordered/unordered_flat_map.hpp index e1633364..c7b0b3ec 100644 --- a/include/boost/unordered/unordered_flat_map.hpp +++ b/include/boost/unordered/unordered_flat_map.hpp @@ -101,9 +101,7 @@ namespace boost { unordered_flat_map& operator=(unordered_flat_map const& other) { - if (this != &other) { - table_ = other.table_; - } + table_ = other.table_; return *this; } diff --git a/include/boost/unordered/unordered_flat_set.hpp b/include/boost/unordered/unordered_flat_set.hpp index 3f075185..b1caed49 100644 --- a/include/boost/unordered/unordered_flat_set.hpp +++ b/include/boost/unordered/unordered_flat_set.hpp @@ -100,9 +100,7 @@ namespace boost { unordered_flat_set& operator=(unordered_flat_set const& other) { - if (this != &other) { - table_ = other.table_; - } + table_ = other.table_; return *this; }