diff options
author | 2023-01-11 11:21:59 +0000 | |
---|---|---|
committer | 2023-02-03 13:33:33 +0000 | |
commit | 6a5b398d98ef0c28f73ea53da302ee2a16e700c1 (patch) | |
tree | 66961f4bd76413d8b24900c6709b8490e9b2cf2e /runtime/exec_utils.cc | |
parent | ab7ce90b00cb9899feb1638eef4efc27ff65ddd0 (diff) |
Fix performance-inefficient-vector-operation clang-tidy issues
Test: m tidy-art
Bug: 264654008
Merged-In: I6b0b495cbb934f9b8caedb389a643428d3cffc47
(cherry picked from commit d59d4d116f9d40113c32c8b1225388308830b099)
Change-Id: Ic0a52fb2c6842d18b292088135a39d6886b69d46
Diffstat (limited to 'runtime/exec_utils.cc')
-rw-r--r-- | runtime/exec_utils.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/runtime/exec_utils.cc b/runtime/exec_utils.cc index dd389f8c97..1021429460 100644 --- a/runtime/exec_utils.cc +++ b/runtime/exec_utils.cc @@ -68,6 +68,7 @@ pid_t ExecWithoutWait(const std::vector<std::string>& arg_vector, std::string* e // Convert the args to char pointers. const char* program = arg_vector[0].c_str(); std::vector<char*> args; + args.reserve(arg_vector.size() + 1); for (const auto& arg : arg_vector) { args.push_back(const_cast<char*>(arg.c_str())); } |