forked from OSchip/llvm-project
[ELF] GnuHashTableSection: replace stable_sort with 2-key sort. NFC
strTabOffset stabilizes llvm::sort. My x86-64 executable is 5+KiB smaller.
This commit is contained in:
parent
4796b4ae7b
commit
f855074ed1
|
@ -2478,8 +2478,9 @@ void GnuHashTableSection::addSymbols(SmallVectorImpl<SymbolTableEntry> &v) {
|
||||||
symbols.push_back({b, ent.strTabOffset, hash, bucketIdx});
|
symbols.push_back({b, ent.strTabOffset, hash, bucketIdx});
|
||||||
}
|
}
|
||||||
|
|
||||||
llvm::stable_sort(symbols, [](const Entry &l, const Entry &r) {
|
llvm::sort(symbols, [](const Entry &l, const Entry &r) {
|
||||||
return l.bucketIdx < r.bucketIdx;
|
return std::tie(l.bucketIdx, l.strTabOffset) <
|
||||||
|
std::tie(r.bucketIdx, r.strTabOffset);
|
||||||
});
|
});
|
||||||
|
|
||||||
v.erase(mid, v.end());
|
v.erase(mid, v.end());
|
||||||
|
|
Loading…
Reference in New Issue