diff options
| author | David Majnemer <david.majnemer@gmail.com> | 2016-08-12 03:55:06 +0000 |
|---|---|---|
| committer | David Majnemer <david.majnemer@gmail.com> | 2016-08-12 03:55:06 +0000 |
| commit | 42531260b3e0cc6256bd64911fc3db7aea59a68e (patch) | |
| tree | bb5d1b3e84331a2673079b42a25135d177d5f8e4 /llvm/tools | |
| parent | 1a2cb97f7b6b0a3ad14c7f076b10a1a19834fac7 (diff) | |
| download | bcm5719-llvm-42531260b3e0cc6256bd64911fc3db7aea59a68e.tar.gz bcm5719-llvm-42531260b3e0cc6256bd64911fc3db7aea59a68e.zip | |
Use the range variant of find/find_if instead of unpacking begin/end
If the result of the find is only used to compare against end(), just
use is_contained instead.
No functionality change is intended.
llvm-svn: 278469
Diffstat (limited to 'llvm/tools')
| -rw-r--r-- | llvm/tools/llvm-objdump/MachODump.cpp | 6 | ||||
| -rw-r--r-- | llvm/tools/llvm-objdump/llvm-objdump.cpp | 23 |
2 files changed, 14 insertions, 15 deletions
diff --git a/llvm/tools/llvm-objdump/MachODump.cpp b/llvm/tools/llvm-objdump/MachODump.cpp index d0ac915e90a..9782659fb52 100644 --- a/llvm/tools/llvm-objdump/MachODump.cpp +++ b/llvm/tools/llvm-objdump/MachODump.cpp @@ -862,9 +862,9 @@ static void DumpLiteralPointerSection(MachOObjectFile *O, } // First look for an external relocation entry for this literal pointer. - auto Reloc = std::find_if( - Relocs.begin(), Relocs.end(), - [&](const std::pair<uint64_t, SymbolRef> &P) { return P.first == i; }); + auto Reloc = find_if(Relocs, [&](const std::pair<uint64_t, SymbolRef> &P) { + return P.first == i; + }); if (Reloc != Relocs.end()) { symbol_iterator RelocSym = Reloc->second; Expected<StringRef> SymName = RelocSym->getName(); diff --git a/llvm/tools/llvm-objdump/llvm-objdump.cpp b/llvm/tools/llvm-objdump/llvm-objdump.cpp index 7482965b784..ec03a6ab815 100644 --- a/llvm/tools/llvm-objdump/llvm-objdump.cpp +++ b/llvm/tools/llvm-objdump/llvm-objdump.cpp @@ -240,18 +240,17 @@ private: llvm::object::ObjectFile const &Object; }; SectionFilter ToolSectionFilter(llvm::object::ObjectFile const &O) { - return SectionFilter([](llvm::object::SectionRef const &S) { - if(FilterSections.empty()) - return true; - llvm::StringRef String; - std::error_code error = S.getName(String); - if (error) - return false; - return std::find(FilterSections.begin(), - FilterSections.end(), - String) != FilterSections.end(); - }, - O); + return SectionFilter( + [](llvm::object::SectionRef const &S) { + if (FilterSections.empty()) + return true; + llvm::StringRef String; + std::error_code error = S.getName(String); + if (error) + return false; + return is_contained(FilterSections, String); + }, + O); } } |

