summaryrefslogtreecommitdiff
path: root/lib/Option/ArgList.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Option/ArgList.cpp')
-rw-r--r--lib/Option/ArgList.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/Option/ArgList.cpp b/lib/Option/ArgList.cpp
index 1f16331e07..a5ab8d747d 100644
--- a/lib/Option/ArgList.cpp
+++ b/lib/Option/ArgList.cpp
@@ -41,14 +41,9 @@ void ArgList::append(Arg *A) {
}
void ArgList::eraseArg(OptSpecifier Id) {
- for (iterator it = begin(), ie = end(); it != ie; ) {
- if ((*it)->getOption().matches(Id)) {
- it = Args.erase(it);
- ie = end();
- } else {
- ++it;
- }
- }
+ Args.erase(std::remove_if(begin(), end(),
+ [=](Arg *A) { return A->getOption().matches(Id); }),
+ end());
}
Arg *ArgList::getLastArgNoClaim(OptSpecifier Id) const {