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/rendering_device_binds.h | |
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/rendering_device_binds.h')
-rw-r--r-- | servers/rendering/rendering_device_binds.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/servers/rendering/rendering_device_binds.h b/servers/rendering/rendering_device_binds.h index ccc3e2fb39..da614877c4 100644 --- a/servers/rendering/rendering_device_binds.h +++ b/servers/rendering/rendering_device_binds.h @@ -351,8 +351,8 @@ public: Vector<StringName> get_version_list() const { Vector<StringName> vnames; - for (Map<StringName, Ref<RDShaderSPIRV>>::Element *E = versions.front(); E; E = E->next()) { - vnames.push_back(E->key()); + for (const KeyValue<StringName, Ref<RDShaderSPIRV>> &E : versions) { + vnames.push_back(E.key); } vnames.sort_custom<StringName::AlphCompare>(); return vnames; @@ -371,9 +371,9 @@ public: if (base_error != "") { ERR_PRINT("Error parsing shader '" + p_file + "':\n\n" + base_error); } else { - for (Map<StringName, Ref<RDShaderSPIRV>>::Element *E = versions.front(); E; E = E->next()) { + for (KeyValue<StringName, Ref<RDShaderSPIRV>> &E : versions) { for (int i = 0; i < RD::SHADER_STAGE_MAX; i++) { - String error = E->get()->get_stage_compile_error(RD::ShaderStage(i)); + String error = E.value->get_stage_compile_error(RD::ShaderStage(i)); if (error != String()) { static const char *stage_str[RD::SHADER_STAGE_MAX] = { "vertex", @@ -383,7 +383,7 @@ public: "compute" }; - ERR_PRINT("Error parsing shader '" + p_file + "', version '" + String(E->key()) + "', stage '" + stage_str[i] + "':\n\n" + error); + ERR_PRINT("Error parsing shader '" + p_file + "', version '" + String(E.key) + "', stage '" + stage_str[i] + "':\n\n" + error); } } } |