diff options
author | Milian Wolff <milian.wolff@kdab.com> | 2014-10-29 19:29:21 +0100 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2014-10-30 18:49:58 +0100 |
commit | b61835946c9dbbaf011f05a2fd20fef73887236c (patch) | |
tree | 19b70e6ddfc05378382205a8343a448923de667c | |
parent | 4b876e08f1e57321f55b1b6e5c5822ba5b3baa87 (diff) | |
download | qt3d-b61835946c9dbbaf011f05a2fd20fef73887236c.tar.gz |
Optimize QHash usage in RenderView::setShaderAndUniforms.
operator[] returns a reference to a default-constructed value
if that does not exist yet. A default-constructed int is 0.
Change-Id: Ic4edcab5893a8601ef705fb17cbbf6a2e84884aa
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
-rw-r--r-- | src/render/backend/renderview.cpp | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/src/render/backend/renderview.cpp b/src/render/backend/renderview.cpp index fdc650a73..cd46caa74 100644 --- a/src/render/backend/renderview.cpp +++ b/src/render/backend/renderview.cpp @@ -737,8 +737,6 @@ void RenderView::setShaderAndUniforms(RenderCommand *command, RenderRenderPass * Q_FOREACH (const LightPair &lightPair, m_data->m_lights) { RenderLight *light = m_renderer->lightManager()->data(lightPair.first); if (light != Q_NULLPTR) { - if (!m_countOfLightTypes.contains(light->lightBlockName())) - m_countOfLightTypes[light->lightBlockName()] = 0; int lightIdx = m_countOfLightTypes[light->lightBlockName()]++; QHash<QString, QVariant> lightProperties = light->lightProperties(); |