summaryrefslogtreecommitdiffstats
path: root/src/render/materialsystem/shaderdata.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2016-02-29 01:01:50 +0100
committerSean Harmer <sean.harmer@kdab.com>2016-05-05 13:21:14 +0000
commit1d8efbbe1256446211d0fcf7821390012c0e537a (patch)
tree349bfc2c7e98128c03085f35f0e729de75af8911 /src/render/materialsystem/shaderdata.cpp
parentd967921923f0af68a35baffa30080a508b214653 (diff)
render/materialsystem: eradicate Q_FOREACH loops [low-risk]
... by replacing them with C++11 range-for loops. To avoid detaches of these mutable Qt containers, wrap the container in qAsConst(), where needed. This is the batch with low-risk changes. They operate on local containers or the loop body clearly does not cause the container to change. Saves ~5.4KiB in text size on optimized GCC 6.0 Linux AMD64 builds. Change-Id: I4343ea0b67b33240896a44df87a60fb460d9ee2d Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/render/materialsystem/shaderdata.cpp')
-rw-r--r--src/render/materialsystem/shaderdata.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/render/materialsystem/shaderdata.cpp b/src/render/materialsystem/shaderdata.cpp
index 58879f72e..75eb96735 100644
--- a/src/render/materialsystem/shaderdata.cpp
+++ b/src/render/materialsystem/shaderdata.cpp
@@ -129,7 +129,8 @@ void ShaderData::clearUpdatedProperties()
while (it != end) {
if (it.value().userType() == QMetaType::QVariantList) {
- Q_FOREACH (const QVariant &v, it.value().value<QVariantList>()) {
+ const auto values = it.value().value<QVariantList>();
+ for (const QVariant &v : values) {
ShaderData *nested = lookupResource(v.value<QNodeId>());
if (nested != nullptr)
nested->clearUpdatedProperties();
@@ -194,7 +195,7 @@ bool ShaderData::updateViewTransform(const QMatrix4x4 &viewMatrix)
QVariantList updatedNodes;
bool nestedNeedsUpdate = false;
const QVariantList values = variant_value<QVariantList>(it.value());
- Q_FOREACH (const QVariant &v, values) {
+ for (const QVariant &v : values) {
if (v.userType() != qNodeIdTypeId)
continue;