diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2015-02-17 15:29:18 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2015-02-17 15:29:18 +0000 |
commit | 6cd780ff2143656df213359b7a6df9a5a9237e17 (patch) | |
tree | b3689d2b8496e1cc569d85b5c59b0ac1d68beace /llvm/lib/Option/ArgList.cpp | |
parent | 2ba8778157390981ba1e4a3b683aee09aa9f009f (diff) | |
download | llvm-6cd780ff2143656df213359b7a6df9a5a9237e17.zip llvm-6cd780ff2143656df213359b7a6df9a5a9237e17.tar.gz llvm-6cd780ff2143656df213359b7a6df9a5a9237e17.tar.bz2 |
Prefer SmallVector::append/insert over push_back loops.
Same functionality, but hoists the vector growth out of the loop.
llvm-svn: 229500
Diffstat (limited to 'llvm/lib/Option/ArgList.cpp')
-rw-r--r-- | llvm/lib/Option/ArgList.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Option/ArgList.cpp b/llvm/lib/Option/ArgList.cpp index b1a916d..85e956f 100644 --- a/llvm/lib/Option/ArgList.cpp +++ b/llvm/lib/Option/ArgList.cpp @@ -253,8 +253,8 @@ void ArgList::AddAllArgValues(ArgStringList &Output, OptSpecifier Id0, OptSpecifier Id1, OptSpecifier Id2) const { for (auto Arg : filtered(Id0, Id1, Id2)) { Arg->claim(); - for (unsigned i = 0, e = Arg->getNumValues(); i != e; ++i) - Output.push_back(Arg->getValue(i)); + const auto &Values = Arg->getValues(); + Output.append(Values.begin(), Values.end()); } } |