From 507b6b3e4bcef3ef280944f3956b7f32ed86985b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Martins?= Date: Tue, 23 Jun 2015 16:18:12 +0100 Subject: Use QList::reserve(), reduces reallocations Change-Id: I9f218bdd65a97ad9c867b695f3ba27ab64a54d2a Reviewed-by: Marc Mutz --- src/plugins/platforms/xcb/qxcbsessionmanager.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/plugins/platforms/xcb/qxcbsessionmanager.cpp') diff --git a/src/plugins/platforms/xcb/qxcbsessionmanager.cpp b/src/plugins/platforms/xcb/qxcbsessionmanager.cpp index 328b72234a..c2101a71c1 100644 --- a/src/plugins/platforms/xcb/qxcbsessionmanager.cpp +++ b/src/plugins/platforms/xcb/qxcbsessionmanager.cpp @@ -134,6 +134,7 @@ static void sm_setProperty(const QString &name, const QStringList &value) SmPropValue *prop = new SmPropValue[value.count()]; int count = 0; QList vl; + vl.reserve(value.size()); for (QStringList::ConstIterator it = value.begin(); it != value.end(); ++it) { prop[count].length = (*it).length(); vl.append((*it).toUtf8()); -- cgit v1.2.3