summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Krus <mike.krus@kdab.com>2017-05-01 14:45:51 +0100
committerMike Krus <mike.krus@kdab.com>2017-05-02 08:47:08 +0000
commit5e86850397399d6fbd11173c428e2dac8a4c1682 (patch)
treee07a7c8924274e99aa45b892dee92b4f136abae6
parent348956c8e270d0c38f495201b99b21634c75b0fa (diff)
Remove unneeded temporary container (clazy reports)
Change-Id: I2a7a94d7b2791382699b39dda1189bc78ce0ff06 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
-rw-r--r--src/core/qscene.cpp8
-rw-r--r--src/plugins/sceneparsers/gltf/gltfimporter.cpp4
-rw-r--r--src/plugins/sceneparsers/gltfexport/gltfexporter.cpp12
3 files changed, 17 insertions, 7 deletions
diff --git a/src/core/qscene.cpp b/src/core/qscene.cpp
index 33841574e..043b3f11b 100644
--- a/src/core/qscene.cpp
+++ b/src/core/qscene.cpp
@@ -222,7 +222,13 @@ bool QScene::hasEntityForComponent(QNodeId componentUuid, QNodeId entityUuid)
{
Q_D(QScene);
QReadLocker lock(&d->m_lock);
- return d->m_componentToEntities.values(componentUuid).contains(entityUuid);
+ auto it = d->m_componentToEntities.find(componentUuid);
+ while (it != d->m_componentToEntities.end() && it.key() == componentUuid) {
+ if (it.value() == entityUuid)
+ return true;
+ ++it;
+ }
+ return false;
}
QScene::NodePropertyTrackData QScene::lookupNodePropertyTrackData(QNodeId id) const
diff --git a/src/plugins/sceneparsers/gltf/gltfimporter.cpp b/src/plugins/sceneparsers/gltf/gltfimporter.cpp
index 5c209aa8a..6f61d2ed9 100644
--- a/src/plugins/sceneparsers/gltf/gltfimporter.cpp
+++ b/src/plugins/sceneparsers/gltf/gltfimporter.cpp
@@ -1072,8 +1072,8 @@ void GLTFImporter::cleanup()
m_shaderPaths.clear();
delete_if_without_parent(m_programs);
m_programs.clear();
- for (const auto &params : m_techniqueParameters.values())
- delete_if_without_parent(params);
+ for (auto it = m_techniqueParameters.begin(); it != m_techniqueParameters.end(); ++it)
+ delete_if_without_parent(it.value());
m_techniqueParameters.clear();
delete_if_without_parent(m_techniques);
m_techniques.clear();
diff --git a/src/plugins/sceneparsers/gltfexport/gltfexporter.cpp b/src/plugins/sceneparsers/gltfexport/gltfexporter.cpp
index fce7d5881..571607fc4 100644
--- a/src/plugins/sceneparsers/gltfexport/gltfexporter.cpp
+++ b/src/plugins/sceneparsers/gltfexport/gltfexporter.cpp
@@ -1153,7 +1153,8 @@ bool GLTFExporter::saveScene()
QVector<MeshInfo::BufferView> bvList;
QVector<MeshInfo::Accessor> accList;
- for (auto &mi : m_meshInfo.values()) {
+ for (auto it = m_meshInfo.begin(); it != m_meshInfo.end(); ++it) {
+ auto &mi = it.value();
for (auto &v : mi.views)
bvList << v;
for (auto &acc : mi.accessors)
@@ -1220,7 +1221,8 @@ bool GLTFExporter::saveScene()
m_obj["accessors"] = accessors;
QJsonObject meshes;
- for (const auto &meshInfo : m_meshInfo.values()) {
+ for (auto it = m_meshInfo.begin(); it != m_meshInfo.end(); ++it) {
+ auto &meshInfo = it.value();
QJsonObject mesh;
mesh["name"] = meshInfo.originalName;
if (meshInfo.meshType != TypeNone) {
@@ -1251,7 +1253,8 @@ bool GLTFExporter::saveScene()
m_obj["meshes"] = meshes;
QJsonObject cameras;
- for (const auto &camInfo : m_cameraInfo.values()) {
+ for (auto it = m_cameraInfo.begin(); it != m_cameraInfo.end(); ++it) {
+ const auto &camInfo = it.value();
QJsonObject camera;
QJsonObject proj;
proj["znear"] = camInfo.znear;
@@ -1305,7 +1308,8 @@ bool GLTFExporter::saveScene()
// Lights must be declared as extensions to the top-level glTF object
QJsonObject lights;
- for (const auto &lightInfo : m_lightInfo.values()) {
+ for (auto it = m_lightInfo.begin(); it != m_lightInfo.end(); ++it) {
+ const auto &lightInfo = it.value();
QJsonObject light;
QJsonObject lightDetails;
QString type;