File tree Expand file tree Collapse file tree 2 files changed +5
-10
lines changed Expand file tree Collapse file tree 2 files changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -1939,11 +1939,8 @@ bool AndroidPackedRelocationSection<ELFT>::updateAllocSize(Ctx &ctx) {
1939
1939
// For Rela, we also want to sort by r_addend when r_info is the same. This
1940
1940
// enables us to group by r_addend as well.
1941
1941
llvm::sort (nonRelatives, [](const Elf_Rela &a, const Elf_Rela &b) {
1942
- if (a.r_info != b.r_info )
1943
- return a.r_info < b.r_info ;
1944
- if (a.r_addend != b.r_addend )
1945
- return a.r_addend < b.r_addend ;
1946
- return a.r_offset < b.r_offset ;
1942
+ return std::tie (a.r_info , a.r_addend , a.r_offset ) <
1943
+ std::tie (b.r_info , b.r_addend , b.r_offset );
1947
1944
});
1948
1945
1949
1946
// Group relocations with the same r_info. Note that each group emits a group
Original file line number Diff line number Diff line change @@ -535,11 +535,9 @@ void UnwindInfoSectionImpl::finalize() {
535
535
llvm::sort (commonEncodings,
536
536
[](const std::pair<compact_unwind_encoding_t , size_t > &a,
537
537
const std::pair<compact_unwind_encoding_t , size_t > &b) {
538
- if (a.second == b.second )
539
- // When frequencies match, secondarily sort on encoding
540
- // to maintain parity with validate-unwind-info.py
541
- return a.first > b.first ;
542
- return a.second > b.second ;
538
+ // When frequencies match, secondarily sort on encoding
539
+ // to maintain parity with validate-unwind-info.py
540
+ return std::tie (a.second , a.first ) > std::tie (b.second , b.first );
543
541
});
544
542
545
543
// Truncate the vector to 127 elements.
You can’t perform that action at this time.
0 commit comments