summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gdscript_byte_codegen.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2022-05-12 12:36:43 +0200
committerGitHub <noreply@github.com>2022-05-12 12:36:43 +0200
commitedda6ee9f82ec94f993ebf44486ab7d8abcef193 (patch)
tree691c51ea7516990b94303afa334d70c66c512cc4 /modules/gdscript/gdscript_byte_codegen.cpp
parent9b7e16a6b8b80fe61881e8f4df28550e18050dd2 (diff)
parent8b7c7f5a753b43cec10f72b274bb1d70c253652b (diff)
downloadredot-engine-edda6ee9f82ec94f993ebf44486ab7d8abcef193.tar.gz
Merge pull request #60881 from reduz/new-hash-map
Diffstat (limited to 'modules/gdscript/gdscript_byte_codegen.cpp')
-rw-r--r--modules/gdscript/gdscript_byte_codegen.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/modules/gdscript/gdscript_byte_codegen.cpp b/modules/gdscript/gdscript_byte_codegen.cpp
index e72069bcd5..3d5a39bf38 100644
--- a/modules/gdscript/gdscript_byte_codegen.cpp
+++ b/modules/gdscript/gdscript_byte_codegen.cpp
@@ -196,10 +196,8 @@ GDScriptFunction *GDScriptByteCodeGenerator::write_end() {
function->_constant_count = constant_map.size();
function->constants.resize(constant_map.size());
function->_constants_ptr = function->constants.ptrw();
- const Variant *K = nullptr;
- while ((K = constant_map.next(K))) {
- int idx = constant_map[*K];
- function->constants.write[idx] = *K;
+ for (const KeyValue<Variant, int> &K : constant_map) {
+ function->constants.write[K.value] = K.key;
}
} else {
function->_constants_ptr = nullptr;