Refactoring - a nicer code for is_subsequence_of()

Conflicts:
	elf_examples/asm_copy
This commit is contained in:
Serge Lamikhov-Center 2014-11-12 18:36:18 +02:00
parent a88cfacaca
commit 1db119a8ca

View File

@ -490,13 +490,13 @@ class elfio
const std::vector<Elf_Half>& sections1 = seg1->get_sections();
const std::vector<Elf_Half>& sections2 = seg2->get_sections();
bool found = std::search( sections2.begin(), sections2.end(),
sections1.begin(), sections1.end() )
!= sections2.end();
bool found = false;
if ( sections1.size() < sections2.size() ) {
found = std::includes( sections2.begin(), sections2.end(),
sections1.begin(), sections1.end() );
}
return found &&
( sections2.size() != 0 ) &&
( sections1.size() != sections2.size() );
return found;
}
//------------------------------------------------------------------------------