summaryrefslogtreecommitdiffstats
path: root/src/network/ssl/qsslsocket_winrt.cpp
diff options
context:
space:
mode:
authorAnton Kudryavtsev <a.kudryavtsev@netris.ru>2016-02-10 12:14:10 +0300
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2016-03-31 09:16:59 +0000
commitbc2565146a04042c497c5f278d91b6e44b308313 (patch)
treefc17ea27492ec633f0ef1ad3ff59e1daed6b9073 /src/network/ssl/qsslsocket_winrt.cpp
parentf720619e0df51a0bdcb330762fadd7fb254542df (diff)
QtNetwork: use reserve to optimize memory allocation
Change-Id: Ia328bae007831f4b78a5688aaf03ae59c12b7425 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/network/ssl/qsslsocket_winrt.cpp')
-rw-r--r--src/network/ssl/qsslsocket_winrt.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/network/ssl/qsslsocket_winrt.cpp b/src/network/ssl/qsslsocket_winrt.cpp
index 045c89eb0e..5704d6b151 100644
--- a/src/network/ssl/qsslsocket_winrt.cpp
+++ b/src/network/ssl/qsslsocket_winrt.cpp
@@ -215,7 +215,9 @@ QList<QSslCipher> QSslSocketBackendPrivate::defaultCiphers()
const QString protocolStrings[] = { QStringLiteral("SSLv3"), QStringLiteral("TLSv1"),
QStringLiteral("TLSv1.1"), QStringLiteral("TLSv1.2") };
const QSsl::SslProtocol protocols[] = { QSsl::SslV3, QSsl::TlsV1_0, QSsl::TlsV1_1, QSsl::TlsV1_2 };
- for (int i = 0; i < ARRAYSIZE(protocols); ++i) {
+ const int size = static_cast<int>(ARRAYSIZE(protocols));
+ ciphers.reserve(size);
+ for (int i = 0; i < size; ++i) {
QSslCipher cipher;
cipher.d->isNull = false;
cipher.d->name = QStringLiteral("WINRT");