diff options
| author | Rui Ueyama <ruiu@google.com> | 2017-04-05 03:19:06 +0000 |
|---|---|---|
| committer | Rui Ueyama <ruiu@google.com> | 2017-04-05 03:19:06 +0000 |
| commit | 0b2381e71fd0b46b4ff973a8a9d6d54ca909d008 (patch) | |
| tree | 27320b3a88cfdf00c287f42a49c3efab7f8da095 /lld/ELF/LinkerScript.cpp | |
| parent | 2e081a4ff0178cf9e15a68e2d6a9446c1317f962 (diff) | |
| download | bcm5719-llvm-0b2381e71fd0b46b4ff973a8a9d6d54ca909d008.tar.gz bcm5719-llvm-0b2381e71fd0b46b4ff973a8a9d6d54ca909d008.zip | |
Simplify. NFC.
llvm-svn: 299500
Diffstat (limited to 'lld/ELF/LinkerScript.cpp')
| -rw-r--r-- | lld/ELF/LinkerScript.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp index 3590153dcb8..ae72534a30a 100644 --- a/lld/ELF/LinkerScript.cpp +++ b/lld/ELF/LinkerScript.cpp @@ -596,14 +596,10 @@ void LinkerScript::process(BaseCommand &Base) { static OutputSection * findSection(StringRef Name, const std::vector<OutputSection *> &Sections) { - auto End = Sections.end(); - auto HasName = [=](OutputSection *Sec) { return Sec->Name == Name; }; - auto I = std::find_if(Sections.begin(), End, HasName); - std::vector<OutputSection *> Ret; - if (I == End) - return nullptr; - assert(std::find_if(I + 1, End, HasName) == End); - return *I; + for (OutputSection *Sec : Sections) + if (Sec->Name == Name) + return Sec; + return nullptr; } // This function searches for a memory region to place the given output |

