From d0b2eecc9abf3a95b5fbc409a8220e8046631f1c Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Thu, 27 Feb 2020 18:30:17 +0300 Subject: [PATCH] fixed_typemap.hpp: polish move constructor a bit GitHub, plz. --- rpcs3/util/fixed_typemap.hpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/rpcs3/util/fixed_typemap.hpp b/rpcs3/util/fixed_typemap.hpp index a6bfce4225..d39420244b 100644 --- a/rpcs3/util/fixed_typemap.hpp +++ b/rpcs3/util/fixed_typemap.hpp @@ -62,10 +62,11 @@ namespace stx manual_fixed_typemap(const manual_fixed_typemap&) = delete; manual_fixed_typemap(manual_fixed_typemap&& r) noexcept + : m_list(std::move(r.m_list)) + , m_order(std::move(r.m_order)) + , m_init_count(r.m_init_count) { - std::swap(m_list, r.m_list); - std::swap(m_order, r.m_order); - std::swap(m_init_count, r.m_init_count); + r.m_init_count = 0; } manual_fixed_typemap& operator=(const manual_fixed_typemap&) = delete; @@ -80,7 +81,7 @@ namespace stx ~manual_fixed_typemap() { - if (!m_list) + if (!m_list && !m_order) { return; }