From 6a5b398d98ef0c28f73ea53da302ee2a16e700c1 Mon Sep 17 00:00:00 2001 From: Stefano Cianciulli Date: Wed, 11 Jan 2023 11:21:59 +0000 Subject: 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 --- runtime/exec_utils.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'runtime/exec_utils.cc') 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& arg_vector, std::string* e // Convert the args to char pointers. const char* program = arg_vector[0].c_str(); std::vector args; + args.reserve(arg_vector.size() + 1); for (const auto& arg : arg_vector) { args.push_back(const_cast(arg.c_str())); } -- cgit v1.2.3-59-g8ed1b