mirror of
https://github.com/tiennm99/godot.git
synced 2026-08-08 22:25:15 +00:00
Merge pull request #33012 from madmiraal/vmap-array-operator
Initialise VMap and HashMap values to the default when they are created.
This commit is contained in:
@@ -210,6 +210,7 @@ private:
|
||||
e->next = hash_table[index];
|
||||
e->hash = hash;
|
||||
e->pair.key = p_key;
|
||||
e->pair.data = TData();
|
||||
|
||||
hash_table[index] = e;
|
||||
elements++;
|
||||
|
||||
+1
-2
@@ -196,8 +196,7 @@ public:
|
||||
|
||||
int pos = _find_exact(p_key);
|
||||
if (pos < 0) {
|
||||
V val;
|
||||
pos = insert(p_key, val);
|
||||
pos = insert(p_key, V());
|
||||
}
|
||||
|
||||
return _cowdata.get_m(pos).value;
|
||||
|
||||
Reference in New Issue
Block a user