diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-10-06 11:45:10 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-10-07 14:30:34 +0200 |
commit | 1052aaed63bab5f7c10346c097f95793343df5d5 (patch) | |
tree | 549dbd753b00564312411492d23b8f0b1f585d7c /src/core/renderer | |
parent | 5c1ce9075510d2a9f563c01225e7b960c70b07bb (diff) |
Port from qAsConst() to std::as_const()
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally
starts to bother us (QTBUG-99313), so time to port away from it
now.
Since qAsConst has exactly the same semantics as std::as_const (down
to rvalue treatment, constexpr'ness and noexcept'ness), there's really
nothing more to it than a global search-and-replace.
Task-number: QTBUG-99313
Change-Id: I4b5f85df579532c2af938fe70db945ba273782fb
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core/renderer')
-rw-r--r-- | src/core/renderer/user_resource_controller.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/renderer/user_resource_controller.cpp b/src/core/renderer/user_resource_controller.cpp index 4a0ba9e43..1588f26ec 100644 --- a/src/core/renderer/user_resource_controller.cpp +++ b/src/core/renderer/user_resource_controller.cpp @@ -163,7 +163,7 @@ void UserResourceController::runScripts(QtWebEngineCore::UserScriptData::Injecti QList<uint64_t> scriptsToRun = m_frameUserScriptMap.value(globalScriptsIndex); scriptsToRun.append(m_frameUserScriptMap.value(renderFrame)); - for (uint64_t id : qAsConst(scriptsToRun)) { + for (uint64_t id : std::as_const(scriptsToRun)) { const QtWebEngineCore::UserScriptData &script = m_scripts.value(id); if (script.injectionPoint != p || (!script.injectForSubframes && !isMainFrame)) continue; @@ -295,7 +295,7 @@ void UserResourceController::renderFrameDestroyed(content::RenderFrame *renderFr FrameUserScriptMap::iterator it = m_frameUserScriptMap.find(renderFrame); if (it == m_frameUserScriptMap.end()) // ASSERT maybe? return; - for (uint64_t id : qAsConst(it.value())) { + for (uint64_t id : std::as_const(it.value())) { m_scripts.remove(id); } m_frameUserScriptMap.remove(renderFrame); @@ -329,7 +329,7 @@ void UserResourceController::clearScriptsForFrame(content::RenderFrame *frame) FrameUserScriptMap::iterator it = m_frameUserScriptMap.find(frame); if (it == m_frameUserScriptMap.end()) return; - for (uint64_t id : qAsConst(it.value())) + for (uint64_t id : std::as_const(it.value())) m_scripts.remove(id); m_frameUserScriptMap.remove(frame); |