diff options
author | Sérgio Martins <sergio.martins@kdab.com> | 2015-06-01 14:05:41 +0100 |
---|---|---|
committer | Sérgio Martins <sergio.martins@kdab.com> | 2015-06-29 19:31:59 +0000 |
commit | 20147fae60fd062788c51b058ebb70b33d7fd664 (patch) | |
tree | e677f42184ea22f1af510814d11f7afdd6fd027f /src/network/ssl/qsslsocket_openssl.cpp | |
parent | 29e88fd8f066c14a405a52bbfe3715dc3e5e891f (diff) |
Use QVector::reserve() all over the place.
Reduces internal memory fragmentation.
The search criteria was:
QVector::append(), QVector::push_back(), QVector::operator<<()
and QVector::operator+=() calls inside for, do and while loops.
Statements inside ifs and out of loops weren't considered.
Change-Id: Ie5aaf3cdfac938994e6e5dfa5f51de501ed79a0c
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/network/ssl/qsslsocket_openssl.cpp')
-rw-r--r-- | src/network/ssl/qsslsocket_openssl.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp index 55f0f3dd04..a11599d772 100644 --- a/src/network/ssl/qsslsocket_openssl.cpp +++ b/src/network/ssl/qsslsocket_openssl.cpp @@ -671,6 +671,7 @@ void QSslSocketPrivate::resetDefaultEllipticCurves() QVarLengthArray<EC_builtin_curve> builtinCurves(static_cast<int>(curveCount)); if (q_EC_get_builtin_curves(builtinCurves.data(), curveCount) == curveCount) { + curves.reserve(int(curveCount)); for (size_t i = 0; i < curveCount; ++i) { QSslEllipticCurve curve; curve.id = builtinCurves[int(i)].nid; |