mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
map: fix a bug with an incorrect size after delete()
This commit is contained in:
parent
519f2990f2
commit
26f5d34e64
@ -55,6 +55,9 @@ fn new_node(key string, val voidptr, element_size int) &mapnode {
|
||||
fn (m mut map) insert(n mut mapnode, key string, val voidptr) {
|
||||
if n.key == key {
|
||||
C.memcpy(n.val, val, m.element_size)
|
||||
if n.is_empty {
|
||||
m.size++
|
||||
}
|
||||
return
|
||||
}
|
||||
if n.key > key {
|
||||
|
Loading…
x
Reference in New Issue
Block a user