From 111f8e6aecf06c3ebe2b0dbb5ba1de8f3d5b3853 Mon Sep 17 00:00:00 2001 From: Jeremy Rifkin <51220084+jeremy-rifkin@users.noreply.github.com> Date: Mon, 17 Feb 2025 13:51:26 -0600 Subject: [PATCH] Simplify to two move constructors, just use the move assignment operator --- src/symbols/dwarf/dwarf.hpp | 4 +--- src/symbols/dwarf/dwarf_resolver.cpp | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/symbols/dwarf/dwarf.hpp b/src/symbols/dwarf/dwarf.hpp index f643285..aa2c689 100644 --- a/src/symbols/dwarf/dwarf.hpp +++ b/src/symbols/dwarf/dwarf.hpp @@ -555,9 +555,7 @@ namespace libdwarf { } srcfiles(const srcfiles&) = delete; srcfiles(srcfiles&& other) { - std::swap(dbg, other.dbg); - std::swap(dw_srcfiles, other.dw_srcfiles); - std::swap(dw_filecount, other.dw_filecount); + *this = std::move(other); } srcfiles& operator=(const srcfiles&) = delete; srcfiles& operator=(srcfiles&& other) { diff --git a/src/symbols/dwarf/dwarf_resolver.cpp b/src/symbols/dwarf/dwarf_resolver.cpp index 0cfbf3b..8012422 100644 --- a/src/symbols/dwarf/dwarf_resolver.cpp +++ b/src/symbols/dwarf/dwarf_resolver.cpp @@ -78,9 +78,7 @@ namespace libdwarf { } line_table_info(const line_table_info&) = delete; line_table_info(line_table_info&& other) { - std::swap(version, other.version); - std::swap(line_context, other.line_context); - std::swap(line_entries, other.line_entries); + *this = std::move(other); } line_table_info& operator=(const line_table_info&) = delete; line_table_info& operator=(line_table_info&& other) {