From 704da023cc410e12402c800d8718a72d0ca56ee4 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Wed, 10 Feb 2016 23:43:16 +0000 Subject: [PATCH] Reorder code to improve readability. NFC. llvm-svn: 260467 --- lld/ELF/OutputSections.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp index b6b1787..1f1dae6 100644 --- a/lld/ELF/OutputSections.cpp +++ b/lld/ELF/OutputSections.cpp @@ -769,12 +769,12 @@ static int getPriority(StringRef S) { template void OutputSection::sortByPriority() { // Sort sections by priority. typedef std::pair *> Pair; + auto Comp = [](const Pair &A, const Pair &B) { return A.first < B.first; }; + std::vector V; for (InputSection *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); -- 2.7.4