From 0e6f6507d5920e2566f790007b97bda6441ec577 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Mon, 22 Jun 2020 12:25:41 +0200 Subject: Use QList instead of QVector in network Task-number: QTBUG-84469 Change-Id: I7827da68e73ca8ff1e599c836f2157894c452b63 Reviewed-by: Timur Pocheptsov --- src/network/access/qhsts.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/network/access/qhsts.cpp') diff --git a/src/network/access/qhsts.cpp b/src/network/access/qhsts.cpp index e473008305..99c4c605dd 100644 --- a/src/network/access/qhsts.cpp +++ b/src/network/access/qhsts.cpp @@ -40,7 +40,6 @@ #include "qhsts_p.h" #include "QtCore/private/qipaddress_p.h" -#include "QtCore/qvector.h" #include "QtCore/qlist.h" #if QT_CONFIG(settings) @@ -93,7 +92,7 @@ void QHstsCache::updateFromHeaders(const QList> &h } } -void QHstsCache::updateFromPolicies(const QVector &policies) +void QHstsCache::updateFromPolicies(const QList &policies) { for (const auto &policy : policies) updateKnownHost(policy.host(), policy.expiry(), policy.includesSubDomains()); @@ -227,9 +226,9 @@ void QHstsCache::clear() knownHosts.clear(); } -QVector QHstsCache::policies() const +QList QHstsCache::policies() const { - QVector values; + QList values; values.reserve(int(knownHosts.size())); for (const auto &host : knownHosts) values << host.second; @@ -250,7 +249,7 @@ void QHstsCache::setStore(QHstsStore *store) // (and thus the cached policy takes priority over whatever policy we // had in the store for the same host, if any). if (knownHosts.size()) { - const QVector observed(policies()); + const QList observed(policies()); for (const auto &policy : observed) hstsStore->addToObserved(policy); hstsStore->synchronize(); @@ -260,7 +259,7 @@ void QHstsCache::setStore(QHstsStore *store) // the store knows about (well, it can happen we synchronize again as a // result if some policies managed to expire or if we add a new one // from the store to cache): - const QVector restored(store->readPolicies()); + const QList restored(store->readPolicies()); updateFromPolicies(restored); } } -- cgit v1.2.3