From cceeb1ee7e18aac2a21ec72ef669bd6d4490ce2e Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Mon, 13 May 2019 18:19:29 +0200 Subject: QHsts: code tidies 1) Remove a use-after-move. It was benign because the move didn't actually trigger move assignment, as the original object was const. 2) Remove a usage of insert(hint), as the hint was always end(), and there is no reason to believe that that's the insertion place. Change-Id: I71aac8cdc9fb85b6ecef3695bae7b21f022bb60b Reviewed-by: Marc Mutz Reviewed-by: Timur Pocheptsov --- src/network/access/qhsts.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/network/access/qhsts.cpp') diff --git a/src/network/access/qhsts.cpp b/src/network/access/qhsts.cpp index ce70b6af90..0cef0ad3dc 100644 --- a/src/network/access/qhsts.cpp +++ b/src/network/access/qhsts.cpp @@ -145,7 +145,7 @@ void QHstsCache::updateKnownHost(const QString &host, const QDateTime &expires, return; } - knownHosts.insert(pos, {hostName, newPolicy}); + knownHosts.insert({hostName, newPolicy}); #if QT_CONFIG(settings) if (hstsStore) hstsStore->addToObserved(newPolicy); @@ -156,7 +156,7 @@ void QHstsCache::updateKnownHost(const QString &host, const QDateTime &expires, if (newPolicy.isExpired()) knownHosts.erase(pos); else if (pos->second != newPolicy) - pos->second = std::move(newPolicy); + pos->second = newPolicy; else return; -- cgit v1.2.3