From 9a2da3983705090d7c9b671184afe5bc01c04d23 Mon Sep 17 00:00:00 2001 From: George Rimar Date: Fri, 8 Sep 2017 13:40:07 +0000 Subject: [PATCH] [ELF] - Simplify #2. NFC. llvm-svn: 312789 --- lld/ELF/Writer.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index 3697eb7c41b6..1df5a7338657 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -1216,14 +1216,9 @@ static void removeUnusedSyntheticSections() { // If there are no other sections in the output section, remove it from the // output. - if (OS->Commands.empty()) { - // Also remove script commands matching the output section. - llvm::erase_if(Script->Opt.Commands, [&](BaseCommand *Cmd) { - if (auto *Sec = dyn_cast(Cmd)) - return Sec == OS; - return false; - }); - } + if (OS->Commands.empty()) + llvm::erase_if(Script->Opt.Commands, + [&](BaseCommand *Cmd) { return Cmd == OS; }); } } -- GitLab