From 42531260b3e0cc6256bd64911fc3db7aea59a68e Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Fri, 12 Aug 2016 03:55:06 +0000 Subject: 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 --- llvm/tools/llvm-objdump/llvm-objdump.cpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'llvm/tools/llvm-objdump/llvm-objdump.cpp') 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); } } -- cgit v1.2.3