Commit 38b6f4ff authored by Marco Bubke's avatar Marco Bubke

Utils: Reserve a container before you use transform

It is seen as good practice to use Container::reserve if you know the size
in advance.

Change-Id: If1398eaa099f4d3f657778aca46516f9bdec14c9
Reviewed-by: Eike Ziller's avatarEike Ziller <eike.ziller@qt.io>
parent 556df816
......@@ -240,6 +240,7 @@ struct TransformImpl {
static C call(const SC &container, F function)
{
C result;
result.reserve(container.size());
std::transform(container.begin(), container.end(),
inserter(result),
function);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment