summaryrefslogtreecommitdiffstats
path: root/core/templates/a_hash_map.h
diff options
context:
space:
mode:
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. */