summaryrefslogtreecommitdiffstats
path: root/src/network/access/qhsts.cpp
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2019-05-13 18:19:29 +0200
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2019-05-13 19:12:17 +0200
commitcceeb1ee7e18aac2a21ec72ef669bd6d4490ce2e (patch)
treee75748a6b74420f5124443fee083878e6ca76547 /src/network/access/qhsts.cpp
parentc2d2757bccc68e1b981df059786c2e76f2969530 (diff)
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 <marc.mutz@kdab.com> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/network/access/qhsts.cpp')
-rw-r--r--src/network/access/qhsts.cpp4
1 files changed, 2 insertions, 2 deletions
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;