Remove unused var; Use std::swap()

This commit is contained in:
Serge Lamikhov-Center 2020-10-10 08:51:11 +03:00
parent ac54727fe4
commit 49c676ad06

View File

@ -383,7 +383,6 @@ template <class S> class symbol_section_accessor_template
std::function<void( Elf_Xword first, Elf_Xword second )> 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 S> 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