[ExpressionParser] Reserve size before copying over args

We already know the final size here so we might as well reserve it so we
don't have to re-allocate during the loop.

llvm-svn: 349967
This commit is contained in:
Jonas Devlieghere 2018-12-21 22:16:10 +00:00
parent fe36417f6e
commit aa2dc6bfec
1 changed files with 2 additions and 1 deletions

View File

@ -608,7 +608,8 @@ ClangModulesDeclVendor::Create(Target &target) {
new StoringDiagnosticConsumer);
std::vector<const char *> compiler_invocation_argument_cstrs;
compiler_invocation_argument_cstrs.reserve(
compiler_invocation_arguments.size());
for (const std::string &arg : compiler_invocation_arguments) {
compiler_invocation_argument_cstrs.push_back(arg.c_str());
}