[lld] r262174 - Simplify. NFC.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 27 20:48:54 PST 2016


Author: ruiu
Date: Sat Feb 27 22:48:54 2016
New Revision: 262174

URL: http://llvm.org/viewvc/llvm-project?rev=262174&view=rev
Log:
Simplify. NFC.

Modified:
    lld/trunk/ELF/LinkerScript.cpp

Modified: lld/trunk/ELF/LinkerScript.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.cpp?rev=262174&r1=262173&r2=262174&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Sat Feb 27 22:48:54 2016
@@ -65,12 +65,11 @@ ArrayRef<uint8_t> LinkerScript::getFille
 // A and B are mentioned in linker scripts. Otherwise, returns 0
 // to use the default rule which is implemented in Writer.cpp.
 int LinkerScript::compareSections(StringRef A, StringRef B) {
-  auto E = OutSections.end();
-  auto I = std::find_if(OutSections.begin(), E,
-                        [&](OutSection &C) { return C.Name == A; });
-  auto J = std::find_if(OutSections.begin(), E,
-                        [&](OutSection &C) { return C.Name == B; });
-  if (I == E || J == E)
+  auto Begin = OutSections.begin();
+  auto End = OutSections.end();
+  auto I = std::find_if(Begin, End, [&](OutSection &C) { return C.Name == A; });
+  auto J = std::find_if(Begin, End, [&](OutSection &C) { return C.Name == B; });
+  if (I == End || J == End)
     return 0;
   return I < J ? -1 : 1;
 }




More information about the llvm-commits mailing list