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:
Rémi Verschelde 2019-10-24 12:50:48 +02:00 committed by GitHub
commit 31ca1f5aa1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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++;

View File

@ -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;