diff --git a/src/Hooks.cpp b/src/Hooks.cpp index 496104107..a4929a07e 100644 --- a/src/Hooks.cpp +++ b/src/Hooks.cpp @@ -196,6 +196,7 @@ void Hooks::onExit () const // Convert to a vector of strings. std::vector input; + input.reserve(tasks.size()); for (auto& t : tasks) input.push_back (t.composeJSON ()); diff --git a/src/feedback.cpp b/src/feedback.cpp index 19e6c078f..781a3eff4 100644 --- a/src/feedback.cpp +++ b/src/feedback.cpp @@ -47,6 +47,7 @@ static void countTasks (const std::vector &, const std::string&, int&, int std::string taskIdentifiers (const std::vector & tasks) { std::vector identifiers; + identifiers.reserve(tasks.size()); for (const auto& task: tasks) identifiers.push_back (task.identifier (true));