From 016b5bc949b6dfb2f76db2e8b40a40e7eaee6828 Mon Sep 17 00:00:00 2001 From: Anton Kudryavtsev Date: Wed, 19 Oct 2016 12:20:10 +0300 Subject: Plugins: use reserve() to optimize memory allocations Change-Id: Id78ce43137e352292a9933222fe2f92d4ff4d69b Reviewed-by: Edward Welbourne Reviewed-by: Thiago Macieira --- src/plugins/platforms/openwfd/qopenwfdintegration.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/plugins/platforms/openwfd') diff --git a/src/plugins/platforms/openwfd/qopenwfdintegration.cpp b/src/plugins/platforms/openwfd/qopenwfdintegration.cpp index 9ed61f7b2e..4850ca2e45 100644 --- a/src/plugins/platforms/openwfd/qopenwfdintegration.cpp +++ b/src/plugins/platforms/openwfd/qopenwfdintegration.cpp @@ -68,6 +68,7 @@ QOpenWFDIntegration::QOpenWFDIntegration() int actualNumberOfDevices = wfdEnumerateDevices(devices,numberOfDevices,0); Q_ASSERT(actualNumberOfDevices == numberOfDevices); + mDevices.reserve(actualNumberOfDevices); for (int i = 0; i < actualNumberOfDevices; i++) { mDevices.append(new QOpenWFDDevice(this,devices[i])); } -- cgit v1.2.3