| commit | 7bc397cac0f58476b34d20c5d06d8313602071ab | [log] [tgz] |
|---|---|---|
| author | David Tolnay <dtolnay@gmail.com> | Thu Feb 11 23:07:58 2021 -0800 |
| committer | David Tolnay <dtolnay@gmail.com> | Thu Feb 11 23:07:58 2021 -0800 |
| tree | 7d948be55b4bc27f9f32e1fed4ee73fa342a0a14 | |
| parent | 87ed59475df2b48ec38e2f45027b1f66f15dae83 [diff] [blame] |
Remove this != &other checks from move assignment operators
diff --git a/include/cxx.h b/include/cxx.h index b9749de..0744f8c 100644 --- a/include/cxx.h +++ b/include/cxx.h
@@ -824,11 +824,9 @@ template <typename T> Vec<T> &Vec<T>::operator=(Vec &&other) noexcept { - if (this != &other) { - this->drop(); - this->repr = other.repr; - new (&other) Vec(); - } + this->drop(); + this->repr = other.repr; + new (&other) Vec(); return *this; }