From e31d98869df56903e53cf50c4ce42e05063280fa Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Wed, 5 Apr 2017 05:06:17 +0000 Subject: [PATCH] Simplify. NFC. A for-loop is more boring than a find_if, but I think this is easier to read. llvm-svn: 299511 --- lld/ELF/LinkerScript.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp index e2483a9..cf875fc 100644 --- a/lld/ELF/LinkerScript.cpp +++ b/lld/ELF/LinkerScript.cpp @@ -923,10 +923,12 @@ std::vector LinkerScript::createPhdrs() { bool LinkerScript::ignoreInterpSection() { // Ignore .interp section in case we have PHDRS specification // and PT_INTERP isn't listed. - return !Opt.PhdrsCommands.empty() && - llvm::find_if(Opt.PhdrsCommands, [](const PhdrsCommand &Cmd) { - return Cmd.Type == PT_INTERP; - }) == Opt.PhdrsCommands.end(); + if (Opt.PhdrsCommands.empty()) + return false; + for (PhdrsCommand &Cmd : Opt.PhdrsCommands) + if (Cmd.Type == PT_INTERP) + return false; + return true; } uint32_t LinkerScript::getFiller(StringRef Name) { -- 2.7.4