[lld] r369844 - [ELF] Simplify with less_second. NFC

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 24 01:40:20 PDT 2019


Author: maskray
Date: Sat Aug 24 01:40:20 2019
New Revision: 369844

URL: http://llvm.org/viewvc/llvm-project?rev=369844&view=rev
Log:
[ELF] Simplify with less_second. NFC

Modified:
    lld/trunk/ELF/Writer.cpp

Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=369844&r1=369843&r2=369844&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Sat Aug 24 01:40:20 2019
@@ -1294,10 +1294,7 @@ sortISDBySectionOrder(InputSectionDescri
     }
     orderedSections.push_back({isec, i->second});
   }
-  llvm::sort(orderedSections, [&](std::pair<InputSection *, int> a,
-                                  std::pair<InputSection *, int> b) {
-    return a.second < b.second;
-  });
+  llvm::sort(orderedSections, llvm::less_second());
 
   // Find an insertion point for the ordered section list in the unordered
   // section list. On targets with limited-range branches, this is the mid-point




More information about the llvm-commits mailing list