diff --git a/Source/cmInstallScriptHandler.cxx b/Source/cmInstallScriptHandler.cxx index 80e58b6e99..353deeeba0 100644 --- a/Source/cmInstallScriptHandler.cxx +++ b/Source/cmInstallScriptHandler.cxx @@ -72,8 +72,9 @@ int cmInstallScriptHandler::install(unsigned int j) cm::uv_loop_ptr loop; loop.init(); std::vector scripts; + scripts.reserve(this->commands.size()); for (auto const& cmd : this->commands) { - scripts.push_back(InstallScript(cmd)); + scripts.emplace_back(cmd); } std::size_t working = 0; std::size_t installed = 0;