diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2018-12-21 22:16:10 +0000 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2018-12-21 22:16:10 +0000 |
commit | aa2dc6bfecb0e476d3693c8ecca9f6eed2011451 (patch) | |
tree | 2627714e99c65e4ab9aa41247865fc40fd54d422 | |
parent | fe36417f6eda3772dab98e3a67fc9c4aa5f4cff2 (diff) | |
download | bcm5719-llvm-aa2dc6bfecb0e476d3693c8ecca9f6eed2011451.tar.gz bcm5719-llvm-aa2dc6bfecb0e476d3693c8ecca9f6eed2011451.zip |
[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
-rw-r--r-- | lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp index 049f5b08b1c..ced21dfe0dd 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp @@ -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()); } |