Skip to content

armgit / godot

Public Imported from GitHub
0

Godot Engine – Multi-platform 2D and 3D game engine

Optimize `Dictionary::assign` by avoiding a copy.

Lukas Tenbrink0db1e0f2479f
diff --git a/core/variant/dictionary.cpp b/core/variant/dictionary.cpp
index dca4b69fac4..60b23be80f3 100644
--- a/core/variant/dictionary.cpp
+++ b/core/variant/dictionary.cpp
@@ -556,7 +556,7 @@ void Dictionary::assign(const Dictionary &p_dictionary) {
variant_map.insert(key_data[i], value_data[i]);
}
- _p->variant_map = variant_map;
+ _p->variant_map = std::move(variant_map);
}
const Variant *Dictionary::next(const Variant *p_key) const {