From 49c676ad063b9a92ce9e1b58fd621a99faffd2dd Mon Sep 17 00:00:00 2001 From: Serge Lamikhov-Center Date: Sat, 10 Oct 2020 08:51:11 +0300 Subject: [PATCH] Remove unused var; Use std::swap() --- elfio/elfio_symbols.hpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/elfio/elfio_symbols.hpp b/elfio/elfio_symbols.hpp index b0b6d6e..e0b9f41 100644 --- a/elfio/elfio_symbols.hpp +++ b/elfio/elfio_symbols.hpp @@ -383,7 +383,6 @@ template class symbol_section_accessor_template std::function func ) { const endianess_convertor& convertor = elf_file.get_convertor(); - const Elf_Xword size = symbol_section->get_entry_size(); Elf_Xword first_not_local = 1; // Skip the first entry. It is always NOTYPE @@ -414,11 +413,7 @@ template class symbol_section_accessor_template if ( func ) func( first_not_local, current ); - // Swap the symbols - T tmp; - std::copy( p1, p1 + 1, &tmp ); - std::copy( p2, p2 + 1, p1 ); - std::copy( &tmp, &tmp + 1, p2 ); + std::swap( *p1, *p2 ); } else { // Update 'info' field of the section