diff options
author | Spartan322 <Megacake1234@gmail.com> | 2024-11-15 14:24:07 -0500 |
---|---|---|
committer | Spartan322 <Megacake1234@gmail.com> | 2024-11-15 14:24:07 -0500 |
commit | 4a5836e5462554a738b502aa8bbde5e4a051eb56 (patch) | |
tree | d58eaa8daad3e30c8b84a50e70a21f93b05525c5 /core/templates/a_hash_map.h | |
parent | ac1a49725fc038ae11ef9060fecb2b0f9c6333b2 (diff) | |
parent | 6c05ec3d6732cac44cf85c91db7d3fd1075bcb23 (diff) | |
download | redot-engine-4a5836e5462554a738b502aa8bbde5e4a051eb56.tar.gz |
Merge commit godotengine/godot@6c05ec3d6732cac44cf85c91db7d3fd1075bcb23
Diffstat (limited to 'core/templates/a_hash_map.h')
-rw-r--r-- | core/templates/a_hash_map.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/core/templates/a_hash_map.h b/core/templates/a_hash_map.h index 81b061deb4..e831a65c67 100644 --- a/core/templates/a_hash_map.h +++ b/core/templates/a_hash_map.h @@ -624,10 +624,11 @@ public: } // Inserts an element without checking if it already exists. - void insert_new(const TKey &p_key, const TValue &p_value) { + Iterator insert_new(const TKey &p_key, const TValue &p_value) { DEV_ASSERT(!has(p_key)); uint32_t hash = _hash(p_key); - _insert_element(p_key, p_value, hash); + uint32_t pos = _insert_element(p_key, p_value, hash); + return Iterator(elements + pos, elements, elements + num_elements); } /* Array methods. */ |