[clang-tidy] Reserve memory for vector loop

Found with performance-inefficient-vector-operation

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev 2019-09-27 20:34:25 -07:00 committed by Paul Beckingham
parent ab170e34df
commit 7f86b29aa9
2 changed files with 2 additions and 0 deletions

View file

@ -196,6 +196,7 @@ void Hooks::onExit () const
// Convert to a vector of strings.
std::vector <std::string> input;
input.reserve(tasks.size());
for (auto& t : tasks)
input.push_back (t.composeJSON ());