Fix incorrect use of std::unique

llvm-svn: 309648
This commit is contained in:
Eugene Zemtsov 2017-08-01 01:29:55 +00:00
parent 6cdb5a61b5
commit 9c410c1b21
1 changed files with 4 additions and 2 deletions

View File

@ -616,8 +616,10 @@ void Symtab::SortSymbolIndexesByValue(std::vector<uint32_t> &indexes,
std::stable_sort(indexes.begin(), indexes.end(), comparator);
// Remove any duplicates if requested
if (remove_duplicates)
std::unique(indexes.begin(), indexes.end());
if (remove_duplicates) {
auto last = std::unique(indexes.begin(), indexes.end());
indexes.erase(last, indexes.end());
}
}
uint32_t Symtab::AppendSymbolIndexesWithName(const ConstString &symbol_name,