summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-objdump/llvm-objdump.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2016-08-12 03:55:06 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2016-08-12 03:55:06 +0000
commit42531260b3e0cc6256bd64911fc3db7aea59a68e (patch)
treebb5d1b3e84331a2673079b42a25135d177d5f8e4 /llvm/tools/llvm-objdump/llvm-objdump.cpp
parent1a2cb97f7b6b0a3ad14c7f076b10a1a19834fac7 (diff)
downloadbcm5719-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/llvm-objdump/llvm-objdump.cpp')
-rw-r--r--llvm/tools/llvm-objdump/llvm-objdump.cpp23
1 files changed, 11 insertions, 12 deletions
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);
}
}
OpenPOWER on IntegriCloud