[lld] r260467 - Reorder code to improve readability. NFC.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 10 15:43:16 PST 2016


Author: ruiu
Date: Wed Feb 10 17:43:16 2016
New Revision: 260467

URL: http://llvm.org/viewvc/llvm-project?rev=260467&view=rev
Log:
Reorder code to improve readability. NFC.

Modified:
    lld/trunk/ELF/OutputSections.cpp

Modified: lld/trunk/ELF/OutputSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.cpp?rev=260467&r1=260466&r2=260467&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.cpp (original)
+++ lld/trunk/ELF/OutputSections.cpp Wed Feb 10 17:43:16 2016
@@ -769,12 +769,12 @@ static int getPriority(StringRef S) {
 template <class ELFT> void OutputSection<ELFT>::sortByPriority() {
   // Sort sections by priority.
   typedef std::pair<int, InputSection<ELFT> *> Pair;
+  auto Comp = [](const Pair &A, const Pair &B) { return A.first < B.first; };
+
   std::vector<Pair> V;
   for (InputSection<ELFT> *S : Sections)
     V.push_back({getPriority(S->getSectionName()), S});
-  std::stable_sort(V.begin(), V.end(), [](const Pair &A, const Pair &B) {
-    return A.first < B.first;
-  });
+  std::stable_sort(V.begin(), V.end(), Comp);
   Sections.clear();
   for (Pair &P : V)
     Sections.push_back(P.second);




More information about the llvm-commits mailing list