summaryrefslogtreecommitdiffstats
path: root/core/templates/a_hash_map.h
diff options
context:
space:
mode:
authorSpartan322 <Megacake1234@gmail.com>2024-11-15 14:24:07 -0500
committerSpartan322 <Megacake1234@gmail.com>2024-11-15 14:24:07 -0500
commit4a5836e5462554a738b502aa8bbde5e4a051eb56 (patch)
treed58eaa8daad3e30c8b84a50e70a21f93b05525c5 /core/templates/a_hash_map.h
parentac1a49725fc038ae11ef9060fecb2b0f9c6333b2 (diff)
parent6c05ec3d6732cac44cf85c91db7d3fd1075bcb23 (diff)
downloadredot-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.h5
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. */