diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-09-30 23:52:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-30 23:52:46 +0200 |
commit | 77721b35ba21f2e7e8bb42cf415fccb018517843 (patch) | |
tree | 96b8f7532ae5d923b75bfbac8d6763015b6646bb /servers/rendering/renderer_rd/shader_compiler_rd.cpp | |
parent | 3e1b6304613855cad56938e8a58848f09363a298 (diff) | |
parent | c63b18507d21b8a213c073bced9057b571cdcd7a (diff) |
Merge pull request #51409 from LightningAA/use-map-iterators
Use range iterators for `Map` in most cases
Diffstat (limited to 'servers/rendering/renderer_rd/shader_compiler_rd.cpp')
-rw-r--r-- | servers/rendering/renderer_rd/shader_compiler_rd.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/servers/rendering/renderer_rd/shader_compiler_rd.cpp b/servers/rendering/renderer_rd/shader_compiler_rd.cpp index b95d4b642c..cddb679eba 100644 --- a/servers/rendering/renderer_rd/shader_compiler_rd.cpp +++ b/servers/rendering/renderer_rd/shader_compiler_rd.cpp @@ -566,11 +566,11 @@ String ShaderCompilerRD::_dump_node_code(const SL::Node *p_node, int p_level, Ge int max_texture_uniforms = 0; int max_uniforms = 0; - for (Map<StringName, SL::ShaderNode::Uniform>::Element *E = pnode->uniforms.front(); E; E = E->next()) { - if (SL::is_sampler_type(E->get().type)) { + for (const KeyValue<StringName, SL::ShaderNode::Uniform> &E : pnode->uniforms) { + if (SL::is_sampler_type(E.value.type)) { max_texture_uniforms++; } else { - if (E->get().scope == SL::ShaderNode::Uniform::SCOPE_INSTANCE) { + if (E.value.scope == SL::ShaderNode::Uniform::SCOPE_INSTANCE) { continue; // Instances are indexed directly, don't need index uniforms. } @@ -590,8 +590,8 @@ String ShaderCompilerRD::_dump_node_code(const SL::Node *p_node, int p_level, Ge Vector<StringName> uniform_names; - for (Map<StringName, SL::ShaderNode::Uniform>::Element *E = pnode->uniforms.front(); E; E = E->next()) { - uniform_names.push_back(E->key()); + for (const KeyValue<StringName, SL::ShaderNode::Uniform> &E : pnode->uniforms) { + uniform_names.push_back(E.key); } uniform_names.sort_custom<StringName::AlphCompare>(); //ensure order is deterministic so the same shader is always produced @@ -724,8 +724,8 @@ String ShaderCompilerRD::_dump_node_code(const SL::Node *p_node, int p_level, Ge Vector<StringName> varying_names; - for (Map<StringName, SL::ShaderNode::Varying>::Element *E = pnode->varyings.front(); E; E = E->next()) { - varying_names.push_back(E->key()); + for (const KeyValue<StringName, SL::ShaderNode::Varying> &E : pnode->varyings) { + varying_names.push_back(E.key); } varying_names.sort_custom<StringName::AlphCompare>(); //ensure order is deterministic so the same shader is always produced |